Пример #1
0
        public CTakeAwayForm(Int32 orderIndex)
        {
            InitializeComponent();
            m_cCurrentControl = txtCustomerName;
            m_customerEditStatus = false;
            m_deliveryTime = String.Empty;
            m_orderType = String.Empty;
            m_orderIndex = orderIndex;

            if (orderIndex != 1)
            {
              //  this.ChangeVisibility();
            }
            if (orderIndex == 2 || orderIndex == 3) //If waiting type orders
            {
                this.GetWaitingNumber();
                txtTips.Visible = true;
            }

            CUserManager tempUserManager = new CUserManager();
            CResult tempResult = tempUserManager.GetAllUser();
            if (tempResult.IsSuccess)
            {
                userList = new List<CUserInfo>();
                userList = (List<CUserInfo>)tempResult.Data;
            }

            ScreenTitle = "Takeaway Customer Information";
            m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>();
            if (m_oCommonConstants.UserInfo == null)
                return;
        }
Пример #2
0
        public DialogResult OnEnterPress()
        {
            string password = passwordFiled.Text;

            CUserManager tempUserManager = new CUserManager();
            CUserInfo tempUserInfo = new CUserInfo();

            CCommonConstants oConstant = ConfigManager.GetConfig<CCommonConstants>();

            tempUserInfo = (CUserInfo)tempUserManager.GetUserInfoByUsername(CCurrentUser.User_name).Data;

            CLogin oLogin = new CLogin();
            CUserInfo oUserInfo = new CUserInfo();

            CPcInfoManager tempPcInfoManager = new CPcInfoManager();
            IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());

            CPcInfo tempPcInfo = (CPcInfo)tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString()).Data;

            oUserInfo.UserName = CCurrentUser.User_name;
            RMSGlobal.LoginUserName = CCurrentUser.User_name;
            RMSGlobal.m_iLoginUserID = tempUserInfo.UserID;
            oUserInfo.Password = password;

            oUserInfo.PCID = tempPcInfo.PcID;
            RMSGlobal.m_connectionString = oConstant.DBConnection;
            oLogin = (RmsRemote.CLogin)Activator.GetObject(typeof(RmsRemote.CLogin), oConstant.RemoteURL);

            CResult oResult = oLogin.ProcessLogin(oUserInfo);

            if (oResult.IsSuccess && oResult.Data != null)
            {
                CUserLogin oUserLogin = (CUserLogin)oResult.Data;

                oConstant.UserInfo = oUserLogin.UserInfo;
                lblErrorMessage.Hide();
            }
            else
            {
                string tempStr = oResult.Message;
                if (!tempStr.Equals(String.Empty))
                {
                    lblErrorMessage.Text = tempStr;
                }

                lblErrorMessage.Show();
                return DialogResult.None;
            }

            CCurrentUser.User_id = tempUserInfo.UserID;
            CCurrentUser.Type = tempUserInfo.Type;
            passwordFiled.Clear();
            return  DialogResult.OK;
        }
Пример #3
0
        public CSystemManagementForm()
        {
            InitializeComponent();

            CMouseConfig tempMouseConfig = ConfigManager.GetConfig<CMouseConfig>();
            CCommonConstants tempCommonConstants = ConfigManager.GetConfig<CCommonConstants>();

            CUserAccess tempUserAccess = tempCommonConstants.UserInfo.UserAccess;
            ExitButton.Enabled = tempUserAccess.ExitRms == 1;
            MergeTableButton.Enabled = tempUserAccess.MergeTable == 1;
            OpenDrawerButton.Enabled = tempUserAccess.OpenDrawer == 1;
            ReviewTransactionButton.Enabled = tempUserAccess.ReviewTransaction == 1;
            TillReportingButton.Enabled = tempUserAccess.TillReporting == 1;
            TransfertableButton.Enabled = tempUserAccess.TransferTable == 1;
            ViewReportButton.Enabled = tempUserAccess.ViewReport == 1;
            VoidTableButton.Enabled = tempUserAccess.VoidTable == 1;
            UnlockTableButton.Enabled = tempUserAccess.UnlockTable == 1;
            BookingButton.Enabled = tempUserAccess.Booking == 1;

            //if (tempUserAccess.Users == 1)
            //    UserButton.Enabled = true;

            CustomerButton.Enabled = tempUserAccess.Customers == 1;
            DepositButton.Enabled = tempUserAccess.Deposit == 1;
            UpdateItemsButton.Enabled = tempUserAccess.UpdateItems == 1;

            //if (tempUserAccess.LogRegister == 1)
            //    btnLogRecords.Enabled = true;

            //For Log register this code will be optimized later
            CUserManager tempUserManager = new CUserManager();
            CUserAccess tempUserAccess2 = (CUserAccess)tempUserManager.GetUserAccess(tempCommonConstants.UserInfo).Data;
            //if (tempUserAccess2.LogRegister == 1)
            //    btnLogRecords.Enabled = true;
            //if (tempUserAccess2.ProcessDeliveryTime == 1)
            //{
            //    btnSetDefaultTime.Enabled = true;
            //}
            //if (tempUserAccess2.KitchenText == 1)
            //{
            //    btnKitchenText.Enabled = true;
            //}
            btnSystemSettings.Enabled = tempUserAccess2.SystemSettings == 1;

               // LoadGraph();

            //lblVersionNumber.Text = RMSGlobal.m_rmsVersionNumber;
        }
Пример #4
0
        private void LoadUserButtons()
        {
            try
            {
                CUserManager tempUserManager = new CUserManager();
                List<CUserInfo> tempUserList = new List<CUserInfo>();
                tempUserList = (List<CUserInfo>)tempUserManager.GetAllUser().Data;

                int buttonCount = tempUserList.Count;
                buttons = new UserButton[buttonCount];

                for (int counter = 0; counter < buttonCount; counter++)
                {
                    if (tempUserList[counter].Status == 1)
                        {
                        // NAIN.K modified 06/01/2009

                        string webuser = "******";

                        if (tempUserList[counter].UserName.Replace(" ", " ").ToUpper() != webuser.Replace(" ", " ").ToUpper())
                        {
                            buttons[counter] = new UserButton();
                            buttons[counter].Gender = tempUserList[counter].Gender;
                           // buttons[counter].TouchButton.Text = tempUserList[counter].UserName;
                            buttons[counter].rmsUserName.Text = tempUserList[counter].UserName;
                            buttons[counter].Click += new System.EventHandler(this.UserButton_Click);

                            buttons[counter].Show();
                        }
                    }
                }

                LoadUserPanel();
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
Пример #5
0
        public CResult ProcessLogout(CUserInfo inUserInfo)
        {
            CUserManager oManager = new CUserManager();
            CResult oResult = oManager.LogoutUser(inUserInfo);

            if (oResult.IsSuccess && oResult.Data != null)
            {

            }
            return oResult;
        }
Пример #6
0
        private void ProcessLogin()
        {
            try
            {
                CCommonConstants objCommonConstant = ConfigManager.GetConfig<CCommonConstants>();

                CDalConfig objDalConstant = ConfigManager.GetConfig<CDalConfig>();

                CUserManager tempUserManager = new CUserManager();
                CLogin objLogin = new CLogin();
                CUserInfo objUserInfo = new CUserInfo();

                //objUserInfo.UserName = UserLabel.Text.Trim();

                //objUserInfo.Password = LoginTextBox.Text.Trim();

                objLogin = (RmsRemote.CLogin)Activator.GetObject(typeof(RmsRemote.CLogin), objCommonConstant.RemoteURL);

                CResult objResult = objLogin.ProcessAdminLogin(objUserInfo);

                if (objResult.IsSuccess && objResult.Data != null)
                {
                    CUserLogin objUserLogin = (CUserLogin)objResult.Data;

                    objCommonConstant.UserInfo = objUserLogin.UserInfo;

                    objDalConstant.ConnectionString = objUserLogin.ConnectionStr;
                    RMSGlobal.LogInUserName = objCommonConstant.UserInfo.UserName;

                    objCommonConstant.DBConnection = objUserLogin.ConnectionStr;

                    RMSAdminMdiForm objParent = new RMSAdminMdiForm();  //Previous
                    objParent.Show();
                    this.Hide();
                }
                else
                {
                    //g_ErrorLabel.Show();
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, RMSGlobal.MessageBoxTitle,
                   MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            String sTempHeader = txtHeader.Text.Trim();

            String sTempBody = txtMessage.Text.Trim();

            String sTempFooter = txtFooter.Text.Trim();

            CPrintStyle oPrint = new CPrintStyle();

            oPrint.Header = sTempHeader;

            oPrint.Body = sTempBody;

            oPrint.Footer = sTempFooter;

            CCommonConstants oConstant = ConfigManager.GetConfig<CCommonConstants>();

            oPrint.StyleID = m_styleID;// oConstant.PrintStyleID;

            CUserManager oManager = new CUserManager();

            CResult oResult = oManager.UpdatePrintStyle(oPrint);

            if (oResult.IsSuccess)
            {

                lblSaveStatus.Text = " Receipt style is updated successfully.";

                lblSaveStatus.Visible = true;
            }
            else
            {

                lblSaveStatus.Text = " Could not update receipt style. Please try again.";

                lblSaveStatus.Visible = true;
            }
        }
Пример #8
0
        public CResult ProcessLogin(CUserInfo inUserInfo)
        {
            CResult oNewResult = new CResult();
            try
            {
                CUserManager oManager = new CUserManager();
                CResult oResult = oManager.LoginUser(inUserInfo);
                if (oResult.IsSuccess && oResult.Data != null)
                {
                    CUserInfo oUser = (CUserInfo)oResult.Data;
                    CResult oResult2 = oManager.GetUserAccess(oUser);
                    if (oResult2.IsSuccess && oResult2.Data != null)
                    {
                        CUserAccess oUserAccess = (CUserAccess)oResult2.Data;

                        oUser.UserAccess = oUserAccess;

                        CUserLogin oUserLogin = new CUserLogin();

                        oUserLogin.UserInfo = oUser;

                        CDalConfig oTempDal = ConfigManager.GetConfig<CDalConfig>();

                        String tempConnStr = oTempDal.ConnectionString;

                        oUserLogin.ConnectionStr = tempConnStr;

                        oNewResult.Data = oUserLogin;

                        oNewResult.IsSuccess = true;

                    }
                }
            }
            catch (Exception ex)
            {
            }
            return oNewResult;
        }
Пример #9
0
        private void dgvUsers_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                if (e.ColumnIndex == 6)
                {
                    Int32 userID = Convert.ToInt32("0" + dgvUsers.Rows[e.RowIndex].Cells[0].Value);

                    UpdateUserCtl objUpdateUser = new UpdateUserCtl(userID);
                    objUpdateUser.Parent = this.ParentForm;
                    UserControlManager.UserControls.Push(this);
                    Panel pnl = (Panel)this.ParentForm.Controls["pnlContext"];

                    string s = pnl.Name;

                    objUpdateUser.ParentForm.Controls[s].Controls.Clear();
                    objUpdateUser.ParentForm.Controls[s].Controls.Add(objUpdateUser);
                }

                else if (e.ColumnIndex == 7)
                {
                    if (MessageBox.Show("Are you sure you want to delete the selected user?", RMSGlobal.MessageBoxTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        Int32 userID = 0;

                        bool bTempBool = Int32.TryParse(dgvUsers.Rows[e.RowIndex].Cells[0].Value.ToString(), out userID);

                        if (bTempBool)
                        {
                            CUserInfo objUserInfo = new CUserInfo();

                            objUserInfo.UserID = userID;
                            CUserManager oManager = new CUserManager();

                            CResult oResult = oManager.DeleteUser(objUserInfo);

                            if (oResult.IsSuccess)
                            {
                                dgvUsers.Rows.RemoveAt(e.RowIndex);
                            }
                        }
                    }
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
Пример #10
0
        private void UpdateReceiptStyle_Load(object sender, EventArgs e)
        {
            CPrintStyle oPrint = new CPrintStyle();

            CCommonConstants oConstant = ConfigManager.GetConfig<CCommonConstants>();

            oPrint.StyleID = m_styleID;
            CUserManager oManager = new CUserManager();

            CResult oResult = oManager.GetPrintStyle(oPrint);

            if (oResult.IsSuccess && oResult.Data != null)
            {
                oPrint = (CPrintStyle)oResult.Data;

                txtHeader.Text = oPrint.Header.Trim();

                txtMessage.Text = oPrint.Body.Trim();

                txtFooter.Text = oPrint.Footer.Trim();
            }
        }
Пример #11
0
 private void CMainForm_Load(object sender, EventArgs e)
 {
     try
     {
         tsCallerIdStatus.Text = "Connected on port "+RMSGlobal.m_comPortName;
         tmrCallerInfo.Start();//Starting the caller timer
         CCommonConstants oConstants = ConfigManager.GetConfig<CCommonConstants>();
         tsLblCurrentUser.Text = " Logged in as " + oConstants.UserInfo.UserName + " ";
     }
     catch (Exception exp)
     {
         tsCallerIdStatus.Text = RMSGlobal.m_connectionStatus;
     }
     CUserManager tempUserManager = new CUserManager();
     CResult tempResult = tempUserManager.GetAllUser();
     if (tempResult.IsSuccess)
     {
         userList = new List<CUserInfo>();
         userList = (List<CUserInfo>)tempResult.Data;
     }
 }
Пример #12
0
        private void LoadUserButtons()
        {
            try
            {
                CUserManager tempUserManager = new CUserManager();
                List<CUserInfo> tempUserList = new List<CUserInfo>();
                tempUserList = (List<CUserInfo>)tempUserManager.GetAllUser().Data;

                int buttonCount = tempUserList.Count;
                //buttons = new UserButton[buttonCount];
                buttons = new UserLoginButton[buttonCount];
                for (int counter = 0; counter < buttonCount; counter++)
                {
                    if (tempUserList[counter].Status == 1 && tempUserList[counter].Type != CUserConstant.GetUSerConstant("WAITER"))
                    {
                        // NAIN.K modified 06/01/2009

                        string webuser = "******";

                        if (tempUserList[counter].UserName.Replace(" "," ").ToUpper()!= webuser.Replace(" "," ").ToUpper())
                        {
                       // buttons[counter] = new UserButton();
                        buttons[counter] = new UserLoginButton();
                       // buttons[counter].Gender = tempUserList[counter].Gender;
                        if (tempUserList[counter].Gender == "Female")
                        {
                            buttons[counter].setFemale(true);
                        }

                        //buttons[counter].TouchButton.Text = tempUserList[counter].UserName;
                        buttons[counter].Text = tempUserList[counter].UserName;
                        buttons[counter].Click += new System.EventHandler(this.LogInUserButton_Click);

                        buttons[counter].Show();
                        }
                    }
                }

                LoadUserPanel();
                if (buttons.Length > MAX_USER_BUTTON)
                {
                    UpButton.Visible = true;
                    DownButton.Visible = true;
                }
            }
            catch (Exception ee)
            {
            }
        }
Пример #13
0
        private void Init()
        {
            try
            {
                m_sDiscountType = "Fixed";
                m_dDiscountAmount = 0;

                parentCategoryButtonList = new List<CCategoryButton>();

                category2ButtonList = new List<CCategoryButton>();
                category3ButtonList = new List<CCategoryButton>();
                category4ButtonList = new List<CCategoryButton>();
                m_cCommonConstants = ConfigManager.GetConfig<CCommonConstants>();

                //New Addition at 04/08/2011
                String ConnectionString = m_cCommonConstants.DBConnection;
                SqlDataAdapter daParentCategory = new SqlDataAdapter(SqlQueries.GetQuery(Query.ParentCategoryGetAll), ConnectionString);
                daParentCategory.Fill(dsParentCategory, "ParentCategory");
                daParentCategory.Dispose();
                //New Addition at 08/08/2008
                SqlDataAdapter daCategory3 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category3GetAll), ConnectionString);
                daCategory3.Fill(dsCategory3, "Category3");
                daCategory3.Dispose();

                SqlDataAdapter daCategory4 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category4GetAll), ConnectionString);
                daCategory4.Fill(dsCategory4, "Category4");
                daCategory4.Dispose();

                SqlDataAdapter tempSqlDataAdapter5 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category2GetAll), ConnectionString);
                tempSqlDataAdapter5.Fill(dsCategory2, "Category2");
                tempSqlDataAdapter5.Dispose();

                SqlDataAdapter tempSqlDataAdapter6 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category1GetAll), ConnectionString);
                tempSqlDataAdapter6.Fill(dsCategory1, "Category1");
                tempSqlDataAdapter6.Dispose();

                if (m_cCommonConstants.UserInfo == null)
                    return;

                //Remove Items .This code will be optimized later
                CUserManager tempUserManager = new CUserManager();
                /*CUserAccess tempUserAccess2 = (CUserAccess)tempUserManager.GetUserAccess(m_cCommonConstants.UserInfo).Data;
                if (tempUserAccess2.RemoveItems == 1)
                    g_RemoveButton.Enabled = true;
                 else
                    g_RemoveButton.Enabled = false;*/

                if (m_iType == m_cCommonConstants.TableType)
                    this.g_ConvertButton.Text = "";
                else if (m_iType == m_cCommonConstants.TakeAwayType)
                    this.g_ConvertButton.Text = "Convert to Table";
                // For Food Menu @Mahmud
                foreach (DataRow tempDataRow in Program.initDataSet.Tables["ParentCategory"].Rows)
                {
                    CCategoryButton tempCategoryButton = new CCategoryButton();
                    tempCategoryButton.CategoryID = int.Parse(tempDataRow["parent_cat_id"].ToString());
                    tempCategoryButton.CategoryOrder = int.Parse(tempDataRow["parent_cat_order"].ToString());
                    tempCategoryButton.CategoryLevel = 0;
                    tempCategoryButton.Text = tempDataRow["parent_cat_name"].ToString();

                    tempCategoryButton.Width = 110;//new at 05.03.2010            //   OLD PARENT CATEGORY SIZE AND COLOR
                    tempCategoryButton.Height = tempCategoryButton.Height - 1;
                    tempCategoryButton.BackColor = Color.LightSeaGreen;//Parent colour Change

                    ////tempCategoryButton.Width = 170;
                    ////tempCategoryButton.Height = tempCategoryButton.Height + 10;         // CHANGE MITHU
                    ////tempCategoryButton.BackColor = Color.Firebrick;

                    //#try
                    //#{
                    //# tempCategoryButton.BackColor = Color.FromArgb(Int32.Parse(tempDataRow["cat2_color"].ToString().Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
                    //#  Int32.Parse(tempDataRow["cat2_color"].ToString().Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
                    //#  Int32.Parse(tempDataRow["cat2_color"].ToString().Substring(5, 2), System.Globalization.NumberStyles.HexNumber));
                    //#}
                    //#catch (Exception exp)
                    //#{
                    //# Console.Write(exp.Message);
                    //#}
                    //tempCategoryButton.BackColor = Color.FromName(tempDataRow["cat2_color"].ToString());

                    tempCategoryButton.Click += new EventHandler(parentCategoryButton_Click);
                    parentCategoryButtonList.Add(tempCategoryButton);
                }
                // For Food Menu @Mahmud
                foodMenuPanal.Controls.Clear();

                foreach (CCategoryButton pcb in parentCategoryButtonList)
                {
                 //   foodMenuPanal.Controls.Add(pcb);

                    if (m_iParentNavigationPoint != 0)
                    {
                        foodMenuPanal.Controls.Clear();
                        for (int counter = 0; counter < m_capacity; counter++)
                        {
                            if (parentCategoryButtonList.Count > (m_capacity * m_iParentNavigationPoint + counter))
                            {
                                foodMenuPanal.Controls.Add(parentCategoryButtonList[(m_capacity * m_iParentNavigationPoint + counter)]);
                            }
                        }

                        if (m_iParentNavigationPoint < (parentCategoryButtonList.Count / m_capacity))
                        {
                            if ((m_iParentNavigationPoint + 1) == (parentCategoryButtonList.Count / m_capacity) && (parentCategoryButtonList.Count % m_capacity) == 0)
                            {
                                btnNextParent.Enabled = false;
                            }
                            else
                            {
                                btnNextParent.Enabled = true;
                            }
                        }
                        else
                            btnNextParent.Enabled = false;

                        if (m_iParentNavigationPoint > 0)
                            btnPrevParent.Enabled = true;
                        else
                            btnPrevParent.Enabled = false;
                    }

                    else
                    {
                        foodMenuPanal.Controls.Clear();
                        for (int counter = 0; counter < m_capacity && counter < parentCategoryButtonList.Count; counter++)
                        {
                            foodMenuPanal.Controls.Add(parentCategoryButtonList[counter]);
                        }

                        if (parentCategoryButtonList.Count > m_capacity)
                            btnNextParent.Enabled = true;
                        else
                            btnNextParent.Enabled = false;
                        btnPrevParent.Enabled = false;
                    }
                 //   #endregion

                }

                this.LoadStatusBar();

                if (m_customerEditStatus == true)//If customer edit button is pressed.This function is called for getting the latest information after modification
                {
                    this.FillSummary();
                    m_customerEditStatus = false;
                }
            }
            catch (Exception exp)
            {
                Console.Write(exp.Message);
            }
        }
Пример #14
0
        private void CUserInfoForm_Load(object sender, EventArgs e)
        {
            try
            {
                if (m_sOpType.Equals("Update"))
                {
                    NameTextBox.Text = m_oUserInfo.UserName;
                    PasswordTextBox.Text = m_oUserInfo.Password;
                    ConfirmPassTextBox.Text = m_oUserInfo.Password;
                    UserTypeComboBox.SelectedItem = CUserConstant.GetUSerConstant(m_oUserInfo.Type);

                    if (m_oUserInfo.Gender.ToLower().Equals("male")) GenderComboBox.SelectedIndex = 0;
                    else if (m_oUserInfo.Gender.ToLower().Equals("female")) GenderComboBox.SelectedIndex = 1;

                    if (m_oUserInfo.Status == 1) ActiveRadioButton.Checked = true;
                    else if (m_oUserInfo.Status == 0) InActiveRadioButton.Checked = true;

                    CUserManager tempUserManager = new CUserManager();
                    CUserAccess tempUserAccess = (CUserAccess)tempUserManager.GetUserAccess(m_oUserInfo).Data;

                    if (tempUserAccess.MergeTable == 1) MergeCheckBox.Checked = true;
                    if (tempUserAccess.OpenDrawer == 1) OpenDrawerCheckBox.Checked = true;
                    if (tempUserAccess.ReviewTransaction == 1) ReviewCheckBox.Checked = true;
                    if (tempUserAccess.TillReporting == 1) TillCheckBox.Checked = true;
                    if (tempUserAccess.TransferTable == 1) TransferCheckBox.Checked = true;
                    if (tempUserAccess.UnlockTable == 1) UnlockCheckBox.Checked = true;
                    if (tempUserAccess.ViewReport == 1) ViewCheckBox.Checked = true;
                    if (tempUserAccess.VoidTable == 1) VoidCheckBox.Checked = true;
                    if (tempUserAccess.ExitRms == 1) ExitCheckBox.Checked= true;
                    if (tempUserAccess.Customers == 1) CustomersCheckBox.Checked = true;
                    if (tempUserAccess.Users == 1) UsersCheckBox.Checked = true;
                    if (tempUserAccess.Booking == 1) BookingCheckBox.Checked = true;
                    if (tempUserAccess.Deposit == 1) DepositCheckBox.Checked = true;
                    if (tempUserAccess.UpdateItems == 1) UpdateItemCheckBox.Checked = true;
                    if (tempUserAccess.RemoveItems == 1) chkRemoveItems.Checked = true;
                    if (tempUserAccess.LogRegister == 1) chkLogRegister.Checked = true;

                    if (tempUserAccess.ProcessDeliveryTime == 1) chkProcessTime.Checked = true;
                    if (tempUserAccess.KitchenText == 1) chkManageKitchenText.Checked = true;

                    if (tempUserAccess.SystemSettings == 1) chkSettings.Checked = true;

                }
                m_cCurrentControl = NameTextBox;
            }
            catch (Exception ex)
            {
            }
        }
Пример #15
0
        private void CTableOrderForm_Load(object sender, EventArgs e)
        {
            //g_ServiceChargeButton.Enabled = false; // Change by Mithu
            //dtpStart.Visible = false;
            xmlDoc = new XmlDocument();
            string executableName = System.Reflection.Assembly.GetExecutingAssembly().Location;
            FileInfo executableFileInfo = new FileInfo(executableName);
            currentDirectory = executableFileInfo.DirectoryName + "\\Config";
            xmlDoc.Load(currentDirectory + "\\CommonConstants.xml");
            XmlNode appSettingsNode = xmlDoc.SelectSingleNode("CCommonConstants/PrinterTypeName");

            this.Init();
            this.LoadOrderDetails();
            this.FillSummary();//New added by baruri at 31.01.2009

            CUserManager tempUserManager = new CUserManager();
            CResult tempResult = tempUserManager.GetAllUser();
            if (tempResult.IsSuccess)
            {
                 userList = new List<CUserInfo>();
                userList = (List<CUserInfo>)tempResult.Data;
            }
        }
Пример #16
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            CResult oResult = ValidateForm();

            if (oResult.IsSuccess)
            {
                String sTempUser = txtUserName.Text.Trim();

                //String sTempPass =RMSGlobal.Decrypt(txtPassword.Text.Trim(),true);

                String sTempPass = txtPassword.Text.Trim();

                int iTempType = ((CComboBoxItem)cmbUserType.SelectedItem).Value;

                String sTempGender = cmbSex.SelectedItem.ToString();

                CUserInfo oUser = new CUserInfo();

                oUser.UserName = sTempUser;

                oUser.Password =sTempPass;

                oUser.Type = iTempType;

                oUser.Gender = sTempGender;

                if (rdoActive.Checked)
                {
                    oUser.Status = 1;
                }
                else if (rdoInActive.Checked)
                {
                    oUser.Status = 0;
                }

                CUserAccess oUserAccess = new CUserAccess();

                if (chkOpenDrawer.Checked)
                {

                    oUserAccess.OpenDrawer = 1;
                }

                if (chkReviewTrans.Checked)
                {
                    oUserAccess.ReviewTransaction = 1;
                }

                if (chkVoidTable.Checked)
                {
                    oUserAccess.VoidTable = 1;
                }

                if (chkViewReport.Checked)
                {
                    oUserAccess.ViewReport = 1;
                }

                if (chkTransferTable.Checked)
                {
                    oUserAccess.TransferTable = 1;
                }

                if (chkTillReport.Checked)
                {
                    oUserAccess.TillReporting = 1;
                }

                if (chkMergeTable.Checked)
                {
                    oUserAccess.MergeTable = 1;
                }

                if (chkExitRms.Checked)
                {
                    oUserAccess.ExitRms = 1;
                }

                if (chkUnlockTable.Checked)
                {
                    oUserAccess.UnlockTable = 1;
                }

                if (chkBooking.Checked)
                {
                    oUserAccess.Booking = 1;
                }

                if (chkUsers.Checked)
                {
                    oUserAccess.Users = 1;
                }

                if (chkDeposit.Checked)
                {
                    oUserAccess.Deposit = 1;
                }

                if (chkCustomer.Checked)
                {
                    oUserAccess.Customers = 1;
                }

                if (chkUpdateItems.Checked)
                {
                    oUserAccess.UpdateItems = 1;
                }

                if (chkRemoveItems.Checked)
                {
                    oUserAccess.RemoveItems = 1;
                }

                if (chkLogRegister.Checked)
                {
                    oUserAccess.LogRegister = 1;
                }

                if (chkSettings.Checked)
                {
                    oUserAccess.SystemSettings = 1;
                }

                if (chkRmsAdmin.Checked)
                {
                    oUserAccess.RmsAdminAccess = 1;
                }

                oUser.UserAccess = oUserAccess;

                oUser.UserID = m_userID;

                CUserManager oManager = new CUserManager();

                CResult oResult2 = oManager.UpdateUser(oUser);

                if (oResult2.IsSuccess)
                {
                    lblSaveStatus.Text = "User information has been modified successfully.";

                    lblSaveStatus.Visible = true;
                }
                else
                {
                    lblSaveStatus.Text = oResult2.Message;

                    lblSaveStatus.Visible = true;
                }
            }
            else
            {
                lblSaveStatus.Text = oResult.Message;
                lblSaveStatus.Visible = true;
            }
        }
Пример #17
0
        private void LoadExistingData()
        {
            CUserInfo oUserInfo = new CUserInfo();

            oUserInfo.UserID = m_userID;

            CUserAccess oUserAccess = new CUserAccess();

            CUserManager oManager = new CUserManager();

            CResult oResult = oManager.GetUser(oUserInfo);

            if (oResult.IsSuccess && oResult.Data != null)
            {
                oUserInfo = (CUserInfo)oResult.Data;

                txtUserName.Text = oUserInfo.UserName;

                txtPassword.Text = oUserInfo.Password;

                if (oUserInfo.Gender.Trim().Equals("Male"))
                {
                    cmbSex.SelectedIndex = 0;
                }
                else if (oUserInfo.Gender.Trim().Equals("Female"))
                {
                    cmbSex.SelectedIndex = 1;
                }

                if (oUserInfo.Type == 0)
                {
                    cmbUserType.SelectedIndex = 0;
                }

                else if (oUserInfo.Type == 1)
                {
                    cmbUserType.SelectedIndex = 1;
                }

                if (oUserInfo.Status == 1)
                {
                    rdoActive.Checked = true;
                }
                else if (oUserInfo.Status == 0)
                {
                    rdoInActive.Checked = true;
                }

                CResult oResult2 = oManager.GetUserAccess(oUserInfo);

                if (oResult2.IsSuccess && oResult2.Data != null)
                {
                    oUserAccess = (CUserAccess)oResult2.Data;

                    if (oUserAccess.OpenDrawer == 1)
                    {
                        chkOpenDrawer.Checked = true;
                    }

                    if (oUserAccess.VoidTable == 1)
                    {
                        chkVoidTable.Checked = true;
                    }

                    if (oUserAccess.TransferTable == 1)
                    {
                        chkTransferTable.Checked = true;
                    }

                    if (oUserAccess.MergeTable == 1)
                    {
                        chkMergeTable.Checked = true;
                    }

                    if (oUserAccess.ReviewTransaction == 1)
                    {
                        chkReviewTrans.Checked = true;
                    }

                    if (oUserAccess.ViewReport == 1)
                    {
                        chkViewReport.Checked = true;
                    }

                    if (oUserAccess.TillReporting == 1)
                    {
                        chkTillReport.Checked = true;
                    }

                    if (oUserAccess.ExitRms == 1)
                    {
                        chkExitRms.Checked = true;
                    }

                    if (oUserAccess.UnlockTable == 1)
                    {
                        chkUnlockTable.Checked = true;
                    }

                    if (oUserAccess.Booking == 1)
                    {
                        chkBooking.Checked = true;
                    }

                    if (oUserAccess.Users == 1)
                    {
                        chkUsers.Checked = true;
                    }

                    if (oUserAccess.Deposit == 1)
                    {
                        chkDeposit.Checked = true;
                    }

                    if (oUserAccess.Customers == 1)
                    {
                        chkCustomer.Checked = true;
                    }

                    if (oUserAccess.UpdateItems == 1)
                    {
                        chkUpdateItems.Checked = true;
                    }

                    if (oUserAccess.RemoveItems == 1)
                    {
                        chkRemoveItems.Checked = true;
                    }

                    if (oUserAccess.LogRegister == 1)
                    {
                        chkLogRegister.Checked = true;
                    }

                    if (oUserAccess.SystemSettings == 1)
                    {
                        chkSettings.Checked = true;
                    }
                    if (oUserAccess.RmsAdminAccess == 1)
                    {
                        chkRmsAdmin.Checked = true;
                    }
                }
            }
        }
Пример #18
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmbButtonColor.SelectedValue != null)
                {
                    int iTempInt = Int32.Parse(cmbButtonColor.SelectedValue.ToString());

                    String sTempStr = txtColorName.Text.Trim();

                    if (sTempStr.Equals(String.Empty))
                    {
                    }
                    else
                    {
                        CButtonColor oTempButton = new CButtonColor();

                        oTempButton.ButtonColor = sTempStr;
                        oTempButton.ButtonID = iTempInt;
                        oTempButton.CurrentUserId = RMSGlobal.LogInUserName;
                        oTempButton.LoginDateTime = RMSGlobal.GetCurrentDateTime();

                        CUserManager oManager = new CUserManager();

                        CResult oResult = oManager.UpdateButtonColor(oTempButton);

                        if (oResult.IsSuccess)
                        {
                            lblSaveStatus.Text = "Button color has been saved successfully.";

                            lblSaveStatus.Visible = true;
                        }
                        else
                        {
                            lblSaveStatus.Text = "Could not update the button color. Please try again.";
                            lblSaveStatus.Visible = true;
                        }
                    }
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, RMSGlobal.MessageBoxTitle,
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #19
0
 /// <summary>
 /// Addred By Baruri at 06.09.2008
 /// </summary>
 private void ActivateButtons()
 {
     CUserManager tempUserManager = new CUserManager();
     CUserAccess tempUserAccess2 = (CUserAccess)tempUserManager.GetUserAccess(m_cCommonConstants.UserInfo).Data;
     if (tempUserAccess2.RemoveItems == 1)
     {
         g_RemoveButton.Enabled = true;
     }
     else
     {
         g_RemoveButton.Enabled = false;
     }
 }
Пример #20
0
        private void FinishButton_Click(object sender, EventArgs e)
        {
            try
            {
                CResult tempCheckForValidation = this.ValidateInput();
                if (tempCheckForValidation.IsSuccess)
                {
                    CUserInfo tempUser = new CUserInfo();

                    tempUser.UserName = NameTextBox.Text;

                    //string tempPass =RMSGlobal.Encrypt(PasswordTextBox.Text,true);

                    string tempPass = PasswordTextBox.Text;

                    if (!tempPass.Equals(ConfirmPassTextBox.Text))
                    {
                        MessageBox.Show("Given Password does not match with confirmed password.");
                        PasswordTextBox.Clear();
                        ConfirmPassTextBox.Clear();
                        return;
                    }
                    else
                    {
                        tempUser.Password = tempPass;

                      //  tempUser.Type = UserTypeComboBox.SelectedIndex;
                         tempUser.Type = CUserConstant.GetUSerConstant(UserTypeComboBox.Text);

                        if (GenderComboBox.SelectedIndex == 0) tempUser.Gender = "Male";
                        else if (GenderComboBox.SelectedIndex == 1) tempUser.Gender = "Female";

                        if (ActiveRadioButton.Checked) tempUser.Status = 1;
                        else if (InActiveRadioButton.Checked) tempUser.Status = 0;

                        CUserAccess tempUserAccess = new CUserAccess();
                        if (OpenDrawerCheckBox.Checked) tempUserAccess.OpenDrawer = 1;
                        if (VoidCheckBox.Checked) tempUserAccess.VoidTable = 1;
                        if (TransferCheckBox.Checked) tempUserAccess.TransferTable = 1;
                        if (MergeCheckBox.Checked) tempUserAccess.MergeTable = 1;
                        if (UnlockCheckBox.Checked) tempUserAccess.UnlockTable = 1;
                        if (ReviewCheckBox.Checked) tempUserAccess.ReviewTransaction = 1;
                        if (ViewCheckBox.Checked) tempUserAccess.ViewReport = 1;
                        if (TillCheckBox.Checked) tempUserAccess.TillReporting = 1;
                        if (ExitCheckBox.Checked) tempUserAccess.ExitRms = 1;
                        if (CustomersCheckBox.Checked) tempUserAccess.Customers = 1;
                        if (UsersCheckBox.Checked) tempUserAccess.Users= 1;
                        if (BookingCheckBox.Checked) tempUserAccess.Booking = 1;
                        if (DepositCheckBox.Checked) tempUserAccess.Deposit = 1;
                        if (UpdateItemCheckBox.Checked) tempUserAccess.UpdateItems = 1;
                        if (chkRemoveItems.Checked) tempUserAccess.RemoveItems = 1;
                        if (chkLogRegister.Checked) tempUserAccess.LogRegister = 1;

                        if (chkProcessTime.Checked) tempUserAccess.ProcessDeliveryTime= 1;
                        if (chkManageKitchenText.Checked) tempUserAccess.KitchenText = 1;

                        if (chkSettings.Checked) tempUserAccess.SystemSettings = 1;

                        tempUser.UserAccess = tempUserAccess;

                        CUserManager tempUserManager = new CUserManager();
                        CResult tempResult = new CResult();
                        if (m_sOpType.Equals("Add")) tempResult = tempUserManager.AddUser(tempUser);
                        else if (m_sOpType.Equals("Update"))
                        {
                            tempUser.UserID = m_oUserInfo.UserID;
                            tempResult = tempUserManager.UpdateUser(tempUser);
                        }
                        else ;

                        if (tempResult.IsSuccess)
                        {
                            Form tempMainForm = CFormManager.Forms.Pop();
                            tempMainForm.Show();
                            this.Close();
                        }
                    }
                }
                else
                {
                    MessageBox.Show(tempCheckForValidation.Message);
                    ClearTextBoxes();
                    return;
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #21
0
 public CTakeAwayForm(Int64 inOrderId)
 {
     InitializeComponent();
     ScreenTitle = "Takeaway Customer Information";
     m_cCurrentControl = txtCustomerName;
     m_customerEditStatus = false;
     m_deliveryTime = String.Empty;
     m_orderType = String.Empty;
     m_oCommonConstants = ConfigManager.GetConfig<CCommonConstants>();
     if (m_oCommonConstants.UserInfo == null)
         return;
     m_iOrderID = inOrderId;
     CUserManager tempUserManager = new CUserManager();
     CResult tempResult = tempUserManager.GetAllUser();
     if (tempResult.IsSuccess)
     {
         userList = new List<CUserInfo>();
         userList = (List<CUserInfo>)tempResult.Data;
     }
 }