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);
        }
Пример #2
0
        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);
        }
Пример #3
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);
        }
        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);
        }
Пример #5
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);
        }
Пример #7
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);
        }
Пример #8
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);
        }
Пример #9
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);
        }
Пример #10
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);
        }
Пример #11
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);
        }
Пример #12
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;
            }
        }
Пример #13
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;
                }
            }
        }