Posts

TABLE VALUED FUNCTION

 USE [SystemTracker] GO /****** Object:  UserDefinedFunction [dbo].[FN_WEEKDATE_START_END_WITH_NAME]    Script Date: 17-11-2021 15:36:01 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /*--------------------------------------------------------------------------------------------------------- FUNCTION NAME       : FN_WEEKDATE_START_END_WITH_NAME FUNCTION / PURPOSE : FUNCTION WILL RETURN WHOLE WEEK DATE WITH WEEK DAY NAME TABLE FOR PROVIDED DATE AUTHOR NAME : SATISH SAINI CREATED DATE : 09-10-2018 REVISION HISTORY 1 : -----------------------------------------------------------------------------------------------------------*/ /* SELECT * FROM DBO.FN_WEEKDATE_START_END_WITH_NAME ('2018-10-08') */ ALTER FUNCTION [dbo].[FN_WEEKDATE_START_END_WITH_NAME](@P_DATE DATE) RETURNS @OUTPUTTBL TABLE (WEEKDATE DATE, WEEKDAYNAME VARCHAR(20)) BEGIN --------------------------------------------------------------------------------------------- -- DEFINED PARAMETER(S

TABLE vALUED FUNCTION

 USE [SystemTracker] GO /****** Object:  UserDefinedFunction [dbo].[FN_LAST_WORKINGWEEK]    Script Date: 17-11-2021 15:35:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /*--------------------------------------------------------------------------------------------------------- FUNCTION NAME       : FN_LAST_WORKINGWEEK FUNCTION / PURPOSE : FUNCTION CALCULATES THE LAST WORKING WEEK OF THE USER AUTHOR NAME : PANKAJ SAINI(2470) CREATED DATE : 06-NOV-2017 REVISION HISTORY 1 : BY: PANKAJ SAINI -- ON: 06-NOV-2017 -- REVISION DETAILS: NEW FUNCTION CREATED. -----------------------------------------------------------------------------------------------------------*/ ALTER FUNCTION [dbo].[FN_LAST_WORKINGWEEK]() RETURNS @OUTPUTTBL TABLE (DATEVALSTART DATE, DATEVALEND DATE) BEGIN --------------------------------------------------------------------------------------------- -- DEFINED PARAMETER(S)    | VARIABLE DATA TYPE | DEFAULT VAL -- COMMENTS ---------------

FUNCTION CALCULATES THE TOTAL WORKING TIME ON THE LAST WORKING DAY OF CERTAIN USER

 USE [SystemTracker] GO /****** Object:  UserDefinedFunction [dbo].[FN_TTL_WRKNG_TM_LST_DAY]    Script Date: 17-11-2021 15:33:52 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /*--------------------------------------------------------------------------------------------------------- FUNCTION NAME       : FN_TTL_WRKNG_TM_LST_DAY_02AUG FUNCTION / PURPOSE : FUNCTION CALCULATES THE TOTAL WORKING TIME ON THE LAST WORKING DAY OF  CERTAIN USER AUTHOR NAME : PANKAJ SAINI(2470) CREATED DATE : 08-FEB-2018 REVISION HISTORY 1 : BY: PANKAJ SAINI -- ON: 08-FEB-2018 -- REVISION DETAILS: NEW FUNCTION CREATED. -----------------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------------- EXECUTION STATEMENT--> -------------------- DECLARE @RET FLOAT EXEC @RET =  [FN_TTL_WRKNG_TM_LST_DAY] @EMP_USER_ID = 2323 ,@DATE = '2019-11-29

REMOVE NON ALPHA CHARACHTERS

 USE [SystemTracker] GO /****** Object:  UserDefinedFunction [dbo].[REMOVENONALPHACHARACTERS]    Script Date: 17-11-2021 15:32:54 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER FUNCTION [dbo].[REMOVENONALPHACHARACTERS](@TEMP VARCHAR(5000)) RETURNS VARCHAR(1000) AS BEGIN     DECLARE @KEEPVALUES AS VARCHAR(50)     SET @KEEPVALUES = '%[^A-Z]%'     WHILE PATINDEX(@KEEPVALUES, @TEMP) > 0         SET @TEMP = STUFF(@TEMP, PATINDEX(@KEEPVALUES, @TEMP), 1, '')     RETURN @TEMP END

FUNCTION LAST WORKING DATE

 USE [SystemTracker] GO /****** Object:  UserDefinedFunction [dbo].[FN_LAST_WORKINGDATE]    Script Date: 17-11-2021 15:31:30 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /*--------------------------------------------------------------------------------------------------------- FUNCTION NAME       : FN_LAST_WORKINGDATE FUNCTION / PURPOSE : FUNCTION CALCULATES THE LAST WORKING DAY OF THE USER AUTHOR NAME : PANKAJ SAINI(2470) CREATED DATE : 06-NOV-2017 REVISION HISTORY 1 : BY: PANKAJ SAINI -- ON: 06-NOV-2017 -- REVISION DETAILS: NEW FUNCTION CREATED. ----------------------------------------------------------------------------------------------------------- --EXECUTION STATEMENT    DECLARE @RET DATE  EXEC @RET =  FN_LAST_WORKINGDATE @EMP_USER_ID = 3299, @Nth_DATE = 5;  SELECT @RET      -----------------------------------------------------------------------------------------------------------*/ ALTER FUNCTION [dbo].[FN_LAST_WORKINGDATE](@EMP_USER_ID INT, @Nt
 USE [SystemTracker] GO /****** Object:  StoredProcedure [dbo].[PR_SEND_EMAIL]    Script Date: 04-10-2021 21:13:24 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO --exec [PR_Send_Email] 'Gauri.Shukla@mind-infotech.com','','','','','','Gauri.Shukla@mind-infotech.com','','','UserQueries','gauri' ALTER proc [dbo].[PR_SEND_EMAIL](          @p_MailID_To varchar(1000) ,          @p_Attachment nvarchar(800)='' ,          @p_Bcc_ID varchar(500)='' ,  -- this parameter is not being used.        @p_CC_ID varchar(500)='' ,          @p_ReplyTo_ID varchar(1000)='' ,          @p_BodyText nvarchar(max)='' ,         @p_From_ID varchar(50)='' ,          @p_SourcePCName varchar(50)='' ,          @p_Subject nvarchar(200)='',  @p_EmailType varchar(500),  @p_UserName varchar(50) = 'User'  ,          @p_OTP int=0 ,         @p_Domain varchar(

Cryptography Utility

 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; using System.Text; using System.Security.Cryptography; /// <summary> //' <summary> //   ' This class uses a symmetric key algorithm (Rijndael/AES) to encrypt and  //   ' decrypt data. As long as encryption and decryption routines use the same  //   ' parameters to generate the keys, the keys are guaranteed to be the same. //   ' The class uses static functions with duplicate code to make it easier to  //   ' demonstrate encryption and decryption logic. In a real-life application,  //   ' this may not be the most efficient way of handling encryption, so - as  //   ' soon as you feel comfortable with it - you may want to redesign this class. /// </summary> namespace InsiderTrading.Infrastructure.Common {     public class Cryptography     {         public Cryptography()         {             //             // TODO: Add constructor logic h