Beispiel #1
0
        /// <summary>
        /// Get Data From Database
        /// <para>Use it when to retive data through a stored procedure</para>
        /// </summary>
        public vmRecoverUser Get_CmnUserRecovery(vmRecoverUser model)
        {
            vmRecoverUser recoveredUser = null;
            string        spQuery       = string.Empty;

            try
            {
                if (model != null)
                {
                    using (GenericFactoryFor_RecUser = new vmRecoveryUser_GF())
                    {
                        Hashtable ht = new Hashtable();
                        ht.Add("RecoverEmail", model.RecoverEmail.Trim());

                        spQuery       = "[Get_CmnUserRecovery]";
                        recoveredUser = GenericFactoryFor_RecUser.ExecuteCommandSingle(spQuery, ht);
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            return(recoveredUser);
        }
Beispiel #2
0
        /// <summary>
        /// Get Data From Database
        /// <para>Use it when to retive data through a stored procedure</para>
        /// </summary>
        public vmAuthenticatedUser Get_CmnUserAuthentication(vmLoginUser model)
        {
            vmAuthenticatedUser objAuthUser = null;
            string spQuery = string.Empty;

            try
            {
                if (model != null)
                {
                    using (GenericFactoryFor_AuthUser = new vmAuthenticatedUser_GF())
                    {
                        Hashtable ht = new Hashtable();
                        ht.Add("UserLogin", model.UserLogin.Trim());
                        ht.Add("Password", model.Password.Trim());

                        spQuery     = "[Get_CmnUserAuthentication]";
                        objAuthUser = GenericFactoryFor_AuthUser.ExecuteCommandSingle(spQuery, ht);
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            return(objAuthUser);
        }
Beispiel #3
0
        public vmQuotation GetQuotationMasterById(int?QuotationId, int CompanyID)
        {
            vmQuotation lstQuotation = null;

            GFactory_GF_Quotation = new vmQuotation_GF();

            string spQuery = string.Empty;

            try
            {
                Hashtable ht = new Hashtable();
                ht.Add("QuotationID", QuotationId);
                ht.Add("CompanyId", CompanyID);
                spQuery      = "[dbo].[Get_PurchaseQuotationMaster]";
                lstQuotation = GFactory_GF_Quotation.ExecuteCommandSingle(spQuery, ht);
            }
            catch (Exception e)
            {
                e.ToString();
            }
            return(lstQuotation);;


            //try
            //{
            //    using (_ctxCmn = new ERP_Entities())
            //    {
            //        lstQuotation = (from qcm in _ctxCmn.PurchaseQuotationMasters.Where(s => s.IsDeleted == false && s.QuotationID == QuotationId && s.CompanyID == CompanyID)
            //                              join re in _ctxCmn.InvRequisitionMasters on qcm.RequisitionID equals re.RequisitionID
            //                              join org in _ctxCmn.CmnUsers on qcm.PartyID equals org.UserID
            //                              join cm in _ctxCmn.CmnComboes on qcm.QuotationTypeID equals cm.ComboID
            //                              join curr in _ctxCmn.AccCurrencyInfoes on qcm.CurrencyID equals curr.Id
            //                              select new vmQuotation
            //                              {
            //                                  RequisitionNo = re.RequisitionNo,
            //                                  RequisitionID = re.RequisitionID,
            //                                  QuotationID = qcm.QuotationID,
            //                                  QuotationNo = qcm.QuotationNo,
            //                                  QuotationDate = qcm.QuotationDate,
            //                                  SPRDate = re.RequisitionDate,
            //                                  DeliveryDate = qcm.DeliveryDate,
            //                                  UserID = org.UserID,
            //                                  UserFullName = org.UserFullName,
            //                                  ComboID = cm.ComboID,
            //                                  ComboName = cm.ComboName,
            //                                  CurrencyID = qcm.CurrencyID,
            //                                  Currency = curr.CurrencyName,
            //                                  Remarks = qcm.Remarks
            //                              });
            //    }

            //}
            //catch (Exception ex)
            //{
            //    ex.ToString();
            //}
        }
Beispiel #4
0
        public vmIssueMaster GetIssueMasterByIssueId(int?IssueId, int CompanyID)
        {
            GenericFactory_GF_Issue = new vmIssueMaster_GF();
            vmIssueMaster lstIssue = null;
            string        spQuery  = string.Empty;

            try
            {
                Hashtable ht = new Hashtable();
                ht.Add("IssueId", IssueId);
                ht.Add("CompanyID", CompanyID);
                spQuery  = "[dbo].[Get_InvIssueInfoByIssueId]";
                lstIssue = GenericFactory_GF_Issue.ExecuteCommandSingle(spQuery, ht);
            }
            catch (Exception e)
            {
                e.ToString();
            }
            return(lstIssue);
        }
Beispiel #5
0
        /// <summary>
        /// Save Data To Database
        /// <para>Use it when save data through a stored procedure</para>
        /// </summary>
        public vmUser SaveUser(vmUser model, List <vmCompany> companyList)
        {
            vmUser result = null;

            try
            {
                if (model != null && model.UserGroupID > 0)
                {
                    Hashtable ht = new Hashtable();
                    ht.Add("CompanyID", model.CompanyID);
                    ht.Add("LoggedUser", model.LoggedUser);

                    //Login Account
                    ht.Add("LoginID", model.LoginID ?? null);
                    ht.Add("Email", model.LoginEmail);
                    ht.Add("Phone", model.LoginPhone ?? null);

                    //User Type
                    ht.Add("UserTypeID", model.UserTypeID);
                    ht.Add("UserGroupID", model.UserGroupID);
                    ht.Add("UserTitleID", model.UserTitleID);

                    //User Info
                    ht.Add("UserFirstName", model.UserFirstName ?? null);
                    ht.Add("UserMiddleName", model.UserMiddleName ?? null);
                    ht.Add("UserLastName", model.UserLastName ?? null);
                    ht.Add("GenderID", model.GenderID);
                    ht.Add("ReligionID", model.ReligionID);

                    ht.Add("FathersName", model.FathersName ?? null);
                    ht.Add("MothersName", model.MothersName ?? null);
                    ht.Add("SpouseNane", model.SpouseNane ?? null);

                    //User Parmanent Address
                    ht.Add("ParAddress1", model.ParAddress1 ?? "");
                    ht.Add("ParAddress2", model.ParAddress2 ?? "");
                    ht.Add("ParCountryID", model.ParCountryID);
                    ht.Add("ParStateID", model.ParStateID);
                    ht.Add("ParCityID", model.ParCityID);

                    //User Present Address
                    ht.Add("PreAddress1", model.PreAddress1 ?? "");
                    ht.Add("PreAddress2", model.PreAddress2 ?? "");
                    ht.Add("PreCountryID", model.PreCountryID);
                    ht.Add("PreStateID", model.PreStateID);
                    ht.Add("PreCityID", model.PreCityID);

                    //User Identity
                    ht.Add("UniqueIdentity", model.UniqueIdentity);
                    ht.Add("BloodGroup", model.BloodGroup ?? "");

                    ht.Add("Height", model.Height);
                    ht.Add("DOB", model.DOB);
                    ht.Add("PassportNO", model.PassportNO);
                    ht.Add("NID", model.NID);

                    ht.Add("ImageUrl", model.ImageUrl ?? "");
                    ht.Add("FingerUrl", model.FingerUrl ?? "");
                    ht.Add("SignatureUrl", model.SignatUrl ?? "");

                    //Open User Login Account
                    ht.Add("IsOnlineAccount", model.IsOnlineAccount);

                    //User Job Contract
                    ht.Add("DesignationID", model.DesignationID);
                    ht.Add("DepartmentID", model.DepartmentID);
                    ht.Add("JobContractTypeID", model.JobContractTypeID);

                    //for  CmnACCIntegration
                    ht.Add("AcDetailID", model.AcDetailID);

                    if (model.UserID > 0)
                    {
                        using (GenericFactoryFor_User = new vmUser_GF())
                        {
                            ht.Add("UserID", model.UserID);
                            string spQuery = "[Put_CmnUser]";
                            result = GenericFactoryFor_User.ExecuteCommandSingle(spQuery, ht);
                            if (result != null && companyList.Count > 0)
                            {
                                UpdateUserWiseCompany(model.UserID ?? 0, model.LoggedUser, companyList);
                            }
                        }
                    }
                    else
                    {
                        using (GenericFactoryFor_User = new vmUser_GF())
                        {
                            string spQuery = "[Set_CmnUser]";
                            result = GenericFactoryFor_User.ExecuteCommandSingle(spQuery, ht);
                        }
                        if (result != null && companyList.Count > 0)
                        {
                            SaveUserWiseCompany(result.UserID ?? 0, model.LoggedUser, companyList);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            return(result);
        }