Esempio n. 1
0
        public string GetContactPersonByName(string paraSessionID, string Name, string ContactType, string paraUserID, string currentFormID, string[] conn)
        {
            string Result          = "";
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            /*Begin : Get Existing Records from TempData*/
            List <SP_GetContactPersonsByReferenceID_Result> existingAddToCartList = new List <SP_GetContactPersonsByReferenceID_Result>();

            existingAddToCartList = GetExistingTempDataBySessionIDFormID(paraSessionID, paraUserID, currentFormID, conn);
            /*End*/

            /*Get Filter List [Filter By paraSequence]*/
            SP_GetContactPersonsByReferenceID_Result filterList = new SP_GetContactPersonsByReferenceID_Result();

            filterList = (from exist in existingAddToCartList
                          where exist.Name == Name && exist.ContactType == ContactType
                          select exist).FirstOrDefault();

            if (filterList == null)
            {
            }
            else
            {
                Result = "Same Contact Name Already Exist";
            }


            return(Result);
        }
Esempio n. 2
0
        public SP_GetContactPersonsByReferenceID_Result GetContactDetailFromTempTableBySequence(string paraSessionID, string paraUserID, string currentFormID, int paraSequence, string[] conn)
        {
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            /*Begin : Get Existing Records from TempData*/
            List <SP_GetContactPersonsByReferenceID_Result> existingAddToCartList = new List <SP_GetContactPersonsByReferenceID_Result>();

            existingAddToCartList = GetExistingTempDataBySessionIDFormID(paraSessionID, paraUserID, currentFormID, conn);
            /*End*/

            /*Get Filter List [Filter By paraSequence]*/
            SP_GetContactPersonsByReferenceID_Result filterList = new SP_GetContactPersonsByReferenceID_Result();

            filterList = (from exist in existingAddToCartList
                          where exist.Sequence == paraSequence
                          select exist).FirstOrDefault();
            return(filterList);
        }
Esempio n. 3
0
        /// <summary>
        /// Tis Is Method To Get Existing Record From tContactPersonDetail and tempdata and merge it
        /// </summary>
        /// <param name="paraSessionID"></param>
        /// <param name="paraUserID"></param>
        /// <param name="paraObjectName"></param>
        /// <returns></returns>
        protected List <SP_GetContactPersonsByReferenceID_Result> GetExistingTempDataBySessionIDFormID(string paraSessionID, string paraUserID, string currentformid, string[] conn)
        {
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            List <SP_GetContactPersonsByReferenceID_Result> ObjcontactPersonList = new List <SP_GetContactPersonsByReferenceID_Result>();
            TempData tempdata = new TempData();
            SP_GetContactPersonsByReferenceID_Result tcontact = new SP_GetContactPersonsByReferenceID_Result();

            tempdata = (from temp in ce.TempDatas
                        where temp.SessionID == paraSessionID &&
                        temp.ObjectName == currentformid &&
                        temp.UserID == paraUserID

                        select temp).FirstOrDefault();

            if (tempdata != null)
            {
                ObjcontactPersonList = datahelper.DeserializeEntity1 <SP_GetContactPersonsByReferenceID_Result>(tempdata.Data);
            }
            return(ObjcontactPersonList);
        }
Esempio n. 4
0
        public List <SP_GetContactPersonsByReferenceID_Result> SetValuesToTempData_onChange(string paraSessionID, string paraUserID, string currentformid, int paraSequence, SP_GetContactPersonsByReferenceID_Result paraInput, string[] conn)
        {
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            List <SP_GetContactPersonsByReferenceID_Result> existingList = new List <SP_GetContactPersonsByReferenceID_Result>();

            existingList = GetExistingTempDataBySessionIDFormID(paraSessionID, paraUserID, currentformid, conn);
            SP_GetContactPersonsByReferenceID_Result editRow = new SP_GetContactPersonsByReferenceID_Result();

            editRow = (from exist in existingList
                       where exist.Sequence == paraSequence
                       select exist).FirstOrDefault();
            editRow      = paraInput;
            existingList = existingList.Where(e => e.Sequence != paraSequence).ToList();
            existingList.Add(editRow);
            existingList = (from e in existingList
                            orderby e.Sequence
                            select e).ToList();
            SaveTempDataToDB(existingList, paraSessionID, paraUserID, currentformid, conn);
            return(existingList);
        }
Esempio n. 5
0
        /// <summary>
        /// This Is Method ToInsert Record In to TempData table
        /// </summary>
        /// <param name="ContactPerson"></param>
        /// <param name="paraSessionID"></param>
        /// <param name="paraUserID"></param>
        /// <param name="paraObjectName"></param>
        /// <returns></returns>

        public List <SP_GetContactPersonsByReferenceID_Result> InsertIntoTemp(SP_GetContactPersonsByReferenceID_Result ContactPerson, string paraSessionID, string paraUserID, string currentformid, string[] conn)
        {
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            /*Begin : Get Existing Records from TempData*/
            List <SP_GetContactPersonsByReferenceID_Result> existingContactPersonList = new List <SP_GetContactPersonsByReferenceID_Result>();

            existingContactPersonList = GetExistingTempDataBySessionIDFormID(paraSessionID, paraUserID, currentformid, conn);
            /*End*/

            /*Begin : Merge (Existing + Newly Added) Products to Create TempData of AddToCart*/
            List <SP_GetContactPersonsByReferenceID_Result> mergedContactPersonList = new List <SP_GetContactPersonsByReferenceID_Result>();

            mergedContactPersonList.AddRange(existingContactPersonList);
            ContactPerson.Sequence = existingContactPersonList.Count + 1;
            mergedContactPersonList.Add(ContactPerson);
            /*End*/


            /*Begin : Serialize & Save MergedAddToCartList*/
            SaveTempDataToDB(mergedContactPersonList, paraSessionID, paraUserID, currentformid, conn);
            /*End*/

            return(mergedContactPersonList);
        }