public static JsonResults GetUserBranch(string UserID)
        {
            JsonResults BranchList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    BranchList.ErrorCode    = 1001;
                    BranchList.ErrorMessage = "";
                    return(BranchList);
                }

                AdminManagerSP adminObj = new AdminManagerSP();
                if (adminObj.GetUserBranch(currentUser.CompanyID, currentUser.UserId, string.IsNullOrEmpty(UserID) ? 0 : Convert.ToInt32(UserID), true, out BranchList))
                {
                    BranchList.ErrorCode    = 0;
                    BranchList.ErrorMessage = "";
                }
                else
                {
                    BranchList.ErrorCode    = 1;
                    BranchList.ErrorMessage = "Failed to get branch List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(BranchList);
        }
Example #2
0
        public static JsonResults GetItemGroups()
        {
            JsonResults returnObj = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = 1001;
                    returnObj.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetPickLists(currentUser.CompanyID, currentUser.UserId, "ItemMasterGroup", out returnObj))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = customerObj.GetLastErrorCode();
                    returnObj.ErrorMessage = customerObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
Example #3
0
        public static JSONReturnData SaveBranchDetails(string CompanyID, string BranchID, string BranchDetails, string AddressDetails, string user, string password)
        {
            JSONReturnData OutPutData = new JSONReturnData();

            TailerApp.Common.LoginUser currentUser;
            try
            {
                if (!GetUserSession(out currentUser))
                {
                    OutPutData.errorCode    = 10001;
                    OutPutData.errorMessage = "";
                }

                byte[] EncryptedCurrentpassword = new System.Text.ASCIIEncoding().GetBytes(TailerApp.Common.Cryptography.Encrypt(password));

                AdminManagerSP AdminManager = new AdminManagerSP();
                if (AdminManager._C_AddModifyBranch(string.IsNullOrEmpty(CompanyID) ? 0 : Convert.ToInt32(CompanyID), currentUser.UserId, string.IsNullOrEmpty(BranchID) ? 0 : Convert.ToInt32(BranchID), BranchDetails, AddressDetails, user, EncryptedCurrentpassword))
                {
                    OutPutData.errorCode    = AdminManager.GetLastErrorCode();
                    OutPutData.errorMessage = AdminManager.GetLastError();
                }
                return(OutPutData);
            }
            catch (Exception e)
            {
                OutPutData.errorCode    = -4;
                OutPutData.errorMessage = "Unknown Error Occured";
                Utils.Write(e);
            }
            return(OutPutData);
        }
        public static JSONReturnData SaveChangePassword(string Password)
        {
            JSONReturnData Objuser = new JSONReturnData();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    Objuser.errorCode    = 1001;
                    Objuser.errorMessage = "";
                    return(Objuser);
                }
                byte[] EncryptedCurrentpassword = new System.Text.ASCIIEncoding().GetBytes(Cryptography.Encrypt(Password));

                AdminManagerSP adminObj = new AdminManagerSP();

                if (adminObj.SaveChangePassword(currentUser.CompanyID, currentUser.UserId, EncryptedCurrentpassword))
                {
                    Objuser.errorCode    = 0;
                    Objuser.errorMessage = "";
                }
                else
                {
                    Objuser.errorCode    = 1;
                    Objuser.errorMessage = "Failed to save user. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(Objuser);
        }
Example #5
0
        public static ItemMasterList GetItemList(string InvoiceID)
        {
            ItemMasterList returnObj = new ItemMasterList();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = 1001;
                    returnObj.ErrorMessage = "";
                    return(returnObj);
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetItemMasterList(currentUser.CompanyID, currentUser.UserId, 0, out returnObj, string.IsNullOrEmpty(InvoiceID) ? 0 : Convert.ToInt32(InvoiceID)))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = -1;
                    returnObj.ErrorMessage = "Failed to get Item Details. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
        public static JSONReturnData GetUserDetails()
        {
            JSONReturnData userObj = new JSONReturnData();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    userObj.errorCode    = 1001;
                    userObj.errorMessage = "";
                    return(userObj);
                }
                byte[] EncryptedCurrentpassword;

                AdminManagerSP adminObj = new AdminManagerSP();
                if (adminObj.GetUserDetails(currentUser.CompanyID, currentUser.UserId, out EncryptedCurrentpassword))
                {
                    userObj.errorCode       = 0;
                    userObj.errorMessage    = "";
                    userObj.String_Outvalue = Cryptography.Decrypt(System.Text.Encoding.ASCII.GetString(EncryptedCurrentpassword));
                }
                else
                {
                    userObj.errorCode    = 1;
                    userObj.errorMessage = "Failed to get User List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(userObj);
        }
        public static JsonResults SaveSeriesMaster(string SeriesMasterID, string SeriesMaster)
        {
            JsonResults outobj = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    outobj.ErrorCode    = 1001;
                    outobj.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.SaveSeriesMaster(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, string.IsNullOrEmpty(SeriesMasterID) ? 0 : Convert.ToInt32(SeriesMasterID), SeriesMaster, out outobj))
                {
                    outobj.ErrorCode    = 0;
                    outobj.ErrorMessage = "";
                }
                else
                {
                    outobj.ErrorCode    = -1;
                    outobj.ErrorMessage = "Failed to save Series. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(outobj);
        }
Example #8
0
        public static Struct_UserRole GetRolePermission(string RoleID)
        {
            Struct_UserRole rolePermission = new Struct_UserRole();
            LoginUser       currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    rolePermission.errorCode    = 1001;
                    rolePermission.errorMessage = "";
                    return(rolePermission);
                }

                AdminManagerSP adminObj = new AdminManagerSP();
                if (!adminObj._U_GetRolePermission(currentUser.CompanyID, currentUser.UserId, string.IsNullOrEmpty(RoleID) ? 0 : Convert.ToInt32(RoleID), out rolePermission))
                {
                    rolePermission.errorCode    = adminObj.GetLastErrorCode();
                    rolePermission.errorMessage = adminObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                rolePermission.errorCode    = -4;
                rolePermission.errorMessage = "Unknown Error Occured";
                Utils.Write(ex);
            }

            return(rolePermission);
        }
        public static Struct_UserRole GetRoles()
        {
            Struct_UserRole roleList = new Struct_UserRole();
            LoginUser       currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    roleList.errorCode    = 1001;
                    roleList.errorMessage = "";
                    return(roleList);
                }

                AdminManagerSP adminObj = new AdminManagerSP();
                if (adminObj._U_GetRoles(currentUser.CompanyID, currentUser.UserId, out roleList))
                {
                    roleList.errorCode    = 0;
                    roleList.errorMessage = "";
                }
                else
                {
                    roleList.errorCode    = 1;
                    roleList.errorMessage = "Failed to get Role List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(roleList);
        }
Example #10
0
        public static Struct_Company GetCompanyDetails(string CompanyID)
        {
            Struct_Company OutPutData = new Struct_Company();

            TailerApp.Common.LoginUser currentUser;
            try
            {
                if (!GetUserSession(out currentUser))
                {
                    OutPutData.errorCode    = 10001;
                    OutPutData.errorMessage = "";
                }

                AdminManagerSP AdminManager = new AdminManagerSP();
                if (!AdminManager._C_GetCompanyDetails(string.IsNullOrEmpty(CompanyID) ? 0 : Convert.ToInt32(CompanyID), currentUser.UserId, out OutPutData))
                {
                    OutPutData.errorCode    = AdminManager.GetLastErrorCode();
                    OutPutData.errorMessage = AdminManager.GetLastError();
                }
                return(OutPutData);
            }
            catch (Exception e)
            {
                OutPutData.errorCode    = -4;
                OutPutData.errorMessage = "Unknown Error Occured";
                Utils.Write(e);
            }
            return(OutPutData);
        }
        public static JsonResults GetPincodeDetails(string pincode)
        {
            JsonResults plist = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    plist.ErrorCode    = 1001;
                    plist.ErrorMessage = "";
                    return(plist);
                }

                AdminManagerSP adminObj = new AdminManagerSP();
                if (!adminObj.GetPincodeDetails(currentUser.CompanyID, currentUser.UserId, pincode, out plist))
                {
                    plist.ErrorCode    = adminObj.GetLastErrorCode();
                    plist.ErrorMessage = adminObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                plist.ErrorCode    = -4;
                plist.ErrorMessage = "Unknown Error Occured";
                Utils.Write(ex);
            }

            return(plist);
        }
        public static JsonResults AddEditItemToDB(ItemMaster ItemMaster, int itemMasterID)
        {
            JsonResults returnObj = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = -1001;
                    returnObj.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.AddEditItemMaster(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, itemMasterID, ref ItemMaster))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = customerObj.GetLastErrorCode();
                    returnObj.ErrorMessage = customerObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
Example #13
0
        public static JsonResults GetAuditLogs(string ActivityType, string ActivitID)
        {
            JsonResults SeriesList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    SeriesList.ErrorCode    = 1001;
                    SeriesList.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetAuditLogs(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, ActivityType, string.IsNullOrEmpty(ActivitID) ? 0 : Convert.ToInt32(ActivitID), out SeriesList))
                {
                    SeriesList.ErrorCode    = 0;
                    SeriesList.ErrorMessage = "";
                }
                else
                {
                    SeriesList.ErrorCode    = -1;
                    SeriesList.ErrorMessage = "Failed to get Series. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(SeriesList);
        }
        public static JsonResults AddEditItemRate(string StartDate, string ItemPrice, int ItemRateID, int itemMasterID, string TotalGST,
                                                  string SGSTPer, string SGST, string CGSTPer, string CGST, string BillAmt)
        {
            JsonResults invoiceList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    invoiceList.ErrorCode    = -1001;
                    invoiceList.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.AddEditItemRate(currentUser.CompanyID, currentUser.UserId, ItemRateID, itemMasterID, ItemPrice, StartDate, string.IsNullOrEmpty(TotalGST) ? 0 : Convert.ToSingle(TotalGST),
                                                string.IsNullOrEmpty(SGSTPer) ? 0 : Convert.ToSingle(SGSTPer), string.IsNullOrEmpty(SGST) ? 0 : Convert.ToSingle(SGST), string.IsNullOrEmpty(CGSTPer) ? 0 : Convert.ToSingle(CGSTPer),
                                                string.IsNullOrEmpty(CGST) ? 0 : Convert.ToSingle(CGST), string.IsNullOrEmpty(BillAmt) ? 0 : Convert.ToSingle(BillAmt)))
                {
                    invoiceList.ErrorCode    = 0;
                    invoiceList.ErrorMessage = "";
                }
                else
                {
                    invoiceList.ErrorCode    = customerObj.GetLastErrorCode();
                    invoiceList.ErrorMessage = customerObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(invoiceList);
        }
        public static ItemMasterList GetItemDetails(int itemMasterID)
        {
            ItemMasterList returnObj = new ItemMasterList();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = -1001;
                    returnObj.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetItemMasterList(currentUser.CompanyID, currentUser.UserId, itemMasterID, out returnObj))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = -1;
                    returnObj.ErrorMessage = "Failed to get Item Details. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
Example #16
0
        public static JsonResults GetSeriesMaster(int SeriesMasterID)
        {
            JsonResults SeriesList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    SeriesList.ErrorCode    = 1001;
                    SeriesList.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetSeriesMaster(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, SeriesMasterID, out SeriesList))
                {
                    SeriesList.ErrorCode    = 0;
                    SeriesList.ErrorMessage = "";
                }
                else
                {
                    SeriesList.ErrorCode    = -1;
                    SeriesList.ErrorMessage = "Failed to get Series List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(SeriesList);
        }
        public static JsonResults GetEmployeeList()
        {
            JsonResults emplList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    emplList.ErrorCode    = 1001;
                    emplList.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetEmployeeList(currentUser.CompanyID, currentUser.UserId, false, out emplList))
                {
                    emplList.ErrorCode    = 0;
                    emplList.ErrorMessage = "";
                }
                else
                {
                    emplList.ErrorCode    = -1;
                    emplList.ErrorMessage = "Failed to get Employee List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(emplList);
        }
Example #18
0
        public static Struct_Company GetCompanyAndBranchList()
        {
            Struct_Company records = new Struct_Company();

            TailerApp.Common.LoginUser currentUser;
            try
            {
                if (!GetUserSession(out currentUser))
                {
                    records.errorCode    = 1001;
                    records.errorMessage = "";
                }

                AdminManagerSP AdminManager = new AdminManagerSP();
                if (!AdminManager._C_GetCompanyAndBranchList(0, currentUser.UserId, out records))
                {
                    records.errorCode    = AdminManager.GetLastErrorCode();
                    records.errorMessage = AdminManager.GetLastError();
                }
                return(records);
            }
            catch (Exception ee)
            {
                records.errorCode    = -5;
                records.errorMessage = "Unknown Error occured while canceling Schedules.";
            }
            return(records);
        }
        public static Struct_Employee GetEmployeeMasterDetails(string EmployeeID)
        {
            Struct_Employee empl = new Struct_Employee();
            LoginUser       currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    empl.errorCode    = 1001;
                    empl.errorMessage = "";
                    return(empl);
                }

                AdminManagerSP adminObj = new AdminManagerSP();
                if (!adminObj.GetEmployeeMasterDetails(currentUser.CompanyID, currentUser.UserId, string.IsNullOrEmpty(EmployeeID) ? 0 : Convert.ToInt32(EmployeeID), out empl))
                {
                    empl.errorCode    = adminObj.GetLastErrorCode();
                    empl.errorMessage = adminObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                empl.errorCode    = -4;
                empl.errorMessage = "Unknown Error Occured";
                Utils.Write(ex);
            }

            return(empl);
        }
Example #20
0
        public static JSONReturnData SaveCompanyDetails(string CompanyID, string CompanyDetails, string AddressDetails)
        {
            JSONReturnData OutPutData = new JSONReturnData();

            TailerApp.Common.LoginUser currentUser;
            try
            {
                if (!GetUserSession(out currentUser))
                {
                    OutPutData.errorCode    = 10001;
                    OutPutData.errorMessage = "";
                }

                AdminManagerSP AdminManager = new AdminManagerSP();
                if (AdminManager._C_AddModifyCompany(string.IsNullOrEmpty(CompanyID) ? 0 : Convert.ToInt32(CompanyID), currentUser.UserId, CompanyDetails, AddressDetails))
                {
                    OutPutData.errorCode    = AdminManager.GetLastErrorCode();
                    OutPutData.errorMessage = AdminManager.GetLastError();
                }
                return(OutPutData);
            }
            catch (Exception e)
            {
                OutPutData.errorCode    = -4;
                OutPutData.errorMessage = "Unknown Error Occured";
                Utils.Write(e);
            }
            return(OutPutData);
        }
Example #21
0
        public static JSONReturnData SaveRolePermission(string RoleID, string RoleName, string PermissionAdded, string PermissionRemoved, bool isDeleted, string HomePage)
        {
            JSONReturnData ObjRole = new JSONReturnData();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    ObjRole.errorCode    = 1001;
                    ObjRole.errorMessage = "";
                    return(ObjRole);
                }

                AdminManagerSP adminObj = new AdminManagerSP();
                if (!adminObj._U_ModifyRolePermission(currentUser.CompanyID, currentUser.UserId, RoleName, string.IsNullOrEmpty(RoleID) ? 0 : Convert.ToInt32(RoleID), PermissionAdded, PermissionRemoved, isDeleted, string.IsNullOrEmpty(HomePage) ? 0 : Convert.ToInt32(HomePage), out ObjRole))
                {
                    ObjRole.errorCode    = adminObj.GetLastErrorCode();
                    ObjRole.errorMessage = adminObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                ObjRole.errorCode    = -4;
                ObjRole.errorMessage = "Unknown Error Occured";
                Utils.Write(ex);
            }

            return(ObjRole);
        }
Example #22
0
        public static JsonResults SearchItems(string searchText)
        {
            JsonResults custList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    custList.ErrorCode    = -1001;
                    custList.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.SearchItems(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, searchText, out custList))
                {
                    custList.ErrorCode    = 0;
                    custList.ErrorMessage = "";
                }
                else
                {
                    custList.ErrorCode    = -1;
                    custList.ErrorMessage = "Failed to get Items List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(custList);
        }
Example #23
0
        void SetLogo(byte[] CompanyLogo, string LogoName)
        {
            AdminManagerSP ManagerObj = new AdminManagerSP();

            if (!ManagerObj.SaveCompanyLogo(CURRENT_USER.CompanyID, CURRENT_USER.UserId, CompanyLogo, LogoName))
            {
                Utils.ShowAlert(this, ManagerObj.GetLastError());
            }
            else
            {
                string base64ImageData = Convert.ToBase64String(CompanyLogo, 0, CompanyLogo.Length);
                img_Logo.ImageUrl = "data:image/png;base64," + base64ImageData;
            }
        }
Example #24
0
        void GetLogo()
        {
            byte[]         CompanyLogo = null;
            AdminManagerSP ManagerObj  = new AdminManagerSP();

            if (!ManagerObj.GetCompanyLogo(CURRENT_USER.CompanyID, CURRENT_USER.UserId, out CompanyLogo))
            {
                Utils.ShowAlert(this, ManagerObj.GetLastError());
            }
            else
            {
                if (CompanyLogo != null)
                {
                    string base64ImageData = Convert.ToBase64String(CompanyLogo, 0, CompanyLogo.Length);
                    img_Logo.ImageUrl = "data:image/png;base64," + base64ImageData;
                }
                else
                {
                    img_Logo.Visible = false;
                }
            }
        }
Example #25
0
        /// <summary>
        /// Created by: Anoop
        ///         On: Jan 13th, 2017
        ///Description: To remove company logo for a HHA
        /// </summary>
        protected void btn_Remove_Click(object sender, EventArgs e)
        {
            try
            {
                bool           isSuccess; byte[] CompanyLogo = null;;
                AdminManagerSP ManagerObj = new AdminManagerSP();
                isSuccess = ManagerObj.SaveCompanyLogo(CURRENT_USER.CompanyID, CURRENT_USER.UserId, CompanyLogo, "");

                if (isSuccess == true)
                {
                    Utils.ShowAlert(this, "Company Logo Removed Successfully.");
                }
                else
                {
                    Utils.ShowAlert(this, "There is no logo present for the company");
                }
            }
            catch (Exception ee)
            {
                Utils.Write(ee);
            }
        }
        public static JSONReturnData AddModifyUser(string LoginUserID, string UserName, string LoginID, string RoleID, string Password, bool isPasswordRegenerated, bool isdeleted,
                                                   string EmpoyeeID, string BranchIDs)
        {
            JSONReturnData Objuser = new JSONReturnData();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    Objuser.errorCode    = 1001;
                    Objuser.errorMessage = "";
                    return(Objuser);
                }
                byte[] EncryptedCurrentpassword = new System.Text.ASCIIEncoding().GetBytes(Cryptography.Encrypt(Password));

                AdminManagerSP adminObj = new AdminManagerSP();

                if (adminObj._U_AddModifyUser(currentUser.CompanyID, currentUser.UserId, string.IsNullOrEmpty(LoginUserID) ? 0 : Convert.ToInt32(LoginUserID),
                                              UserName, LoginID, string.IsNullOrEmpty(RoleID) ? 0 : Convert.ToInt32(RoleID), EncryptedCurrentpassword, isPasswordRegenerated, isdeleted, string.IsNullOrEmpty(EmpoyeeID) ? 0 : Convert.ToInt32(EmpoyeeID), BranchIDs))


                {
                    Objuser.errorCode    = 0;
                    Objuser.errorMessage = "";
                }
                else
                {
                    Objuser.errorCode    = 1;
                    Objuser.errorMessage = "Failed to save user. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(Objuser);
        }