コード例 #1
0
ファイル: FixedOrder.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 确认提交方法
        /// </summary>
        public void button_ok()
        {
            if (this.TxtDiscount.Text != null)
            {
                string price_fixed = double.Parse(this.TxtDiscount.Text).ToString("0.00");
                if (price_fixed != "0.00")//判断不能为0
                {
                    Discount ds = new Discount();
                    ds.type = "quota";
                    ds.amount = price_fixed;
                    PassValue.discounts.Add(ds);
                    PassValue.Infor_payment.discounts = new Discount[PassValue.discounts.Count];
                }
                int i = 0;
                foreach (Discount ds in PassValue.discounts)
                {
                    PassValue.Infor_payment.discounts[i++] = ds;
                }

                HttpResult httpResult = httpReq.HttpPatch(string.Format("consumptions/{0}", fixedConsumptionsid), PassValue.Infor_payment);
                if ((int)httpResult.StatusCode == 401)
                {
                    LoginBusiness lg = new LoginBusiness();
                    lg.LoginAgain();
                    return;
                }
                else if ((int)httpResult.StatusCode == 0)
                {
                    MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }
                Form_Esc();
            }
        }
コード例 #2
0
ファイル: ChangeNumber.cs プロジェクト: zhuqinliang/Client
        private void button1_Click(object sender, EventArgs e)
        {
            Consumption c = new Consumption()
            {
                id = consumeid,
                people=int.Parse( this.numericUpDown1.Text)
            };

            HttpResult httpResult = httpReq.HttpPatch(string.Format("consumptions/{0}", PassValue.consumptionid), c);
            if ((int)httpResult.StatusCode == 409)
            {
                MessageBox.Show("有桌子已被操作,请重新输入!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else if ((int)httpResult.StatusCode == 401)
            {
                LoginBusiness lg = new LoginBusiness();
                lg.LoginAgain();
                return;
            }
            else if ((int)httpResult.StatusCode == 0)
            {
                MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }

            Desk d;
            d = (Desk)this.Owner;
            d.Refresh_Method();
            this.Close();
        }
コード例 #3
0
ファイル: AllOrder.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 确认提交方法
        /// </summary>
        public void button_ok()
        {
            if (this.TxtDiscount.Text != null && this.TxtDiscount.Text != "")
            {
                PassValue.Percent = Int32.Parse(this.TxtDiscount.Text);
                if (PassValue.Percent != 0)
                {
                    Discount ds = new Discount();
                    ds.type = "whole";
                    ds.percent = PassValue.Percent;
                    PassValue.discounts.Add(ds);
                }
                PassValue.Infor_payment.discounts = new Discount[PassValue.discounts.Count];
                int i = 0;
                foreach (Discount ds in PassValue.discounts)
                {
                    PassValue.Infor_payment.discounts[i++] = ds;
                }

                HttpResult httpResult = httpReq.HttpPatch(string.Format("consumptions/{0}", orderConsumptionid), PassValue.Infor_payment);
                if ((int)httpResult.StatusCode == 401)
                {
                    LoginBusiness lg = new LoginBusiness();
                    lg.LoginAgain();
                    return;
                }
                else if ((int)httpResult.StatusCode == 0)
                {
                    MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }
                Form_Esc();
            }
        }
コード例 #4
0
        public ActionResult GetProjects(string DistCd, string StateCode, string CenterType = "")
        {
            var _loginBuss = new LoginBusiness();
            var Data       = _loginBuss.GetProject(DistCd, StateCode, CenterType);

            return(Json(Data.AsEnumerable().Select(m => new SelectListItem()
            {
                Text = m.ProjectName, Value = m.ProjectCode.ToString()
            }), JsonRequestBehavior.AllowGet));
        }
コード例 #5
0
        public Task <IdentityResult> CreateAsync(Login user, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            LoginBusiness loginBll = new LoginBusiness(this._connectionOpt);

            loginBll.SalvarOuAtualizar(user);

            return(Task.FromResult(IdentityResult.Success));
        }
コード例 #6
0
        private void ValidarUsuario(string nome, string senha)
        {
            LoginBusiness business = new LoginBusiness();
            UsuarioDTO    user     = business.Autenticar(nome, senha);

            if (user.id_Usuario != Convert.ToInt32(lblIdUser.Text))
            {
                throw new ArgumentException("Usuário não autenticado!");
            }
        }
コード例 #7
0
        public ActionResult GetDistricts(string StateID)
        {
            var _loginBuss = new LoginBusiness();
            var Data       = _loginBuss.GetDistricts(StateID);

            return(Json(Data.AsEnumerable().Select(m => new SelectListItem()
            {
                Text = m.DistrictName, Value = m.DistrictCode.ToString()
            }), JsonRequestBehavior.AllowGet));
        }
コード例 #8
0
        public ActionResult GetCenters(string Seccode, string Project, string StateCode, string CenterType = "")
        {
            var _loginBuss = new LoginBusiness();
            var Data       = _loginBuss.GetCenters(Seccode.Trim(), Project.Trim(), StateCode.Trim(), CenterType);

            return(Json(Data.AsEnumerable().Select(m => new SelectListItem()
            {
                Text = m.AWCName, Value = m.AWCCode.ToString()
            }), JsonRequestBehavior.AllowGet));
        }
コード例 #9
0
        private void LoginExecute()
        {
            LoginBusiness business = new LoginBusiness(UserName, Password, accountingUow);
            business.Execute();

            if (!business.Result.HasException)
                Messenger.Default.Send("Close", "LoginWindow_CloseWindow");
            else
                ShowMessageBox(business.Result.Message.Message, business.Result.Message.Title, Infra.Wpf.Controls.MsgButton.OK, Infra.Wpf.Controls.MsgIcon.Error);
        }
コード例 #10
0
        protected void Page_Init(object sender, EventArgs e)
        {
            if (Session[sessionNames.userID_Karbar] == null)
            {
                Response.Redirect("~/CommonUI/LoginRequestCMS.aspx", false);
            }
            else
            {
                Session[sessionNames.appID_Karbar] = "9";
                LoginBusiness logBusiness = new LoginBusiness();
                //stName.InnerText = Session["name"].ToString();
                DataTable dt     = new DataTable();
                DataTable dtmenu = new DataTable();
                dtmenu.Columns.Add("MenuLink");
                dtmenu.Columns.Add("linkCode");
                dtmenu.Columns.Add("icon");
                dtmenu.Columns.Add("MenuName");
                DataRow dr;

                dt = logBusiness.Get_Menu_ByUserIdAndAppId(int.Parse(Session[sessionNames.appID_Karbar].ToString()), int.Parse(Session[sessionNames.userID_Karbar].ToString()), int.Parse(Session["SectionId"].ToString()));
                string cat = "";

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //if (cat == "")
                    //{
                    //    cat = dt.Rows[i]["CategoryId"].ToString();
                    //    lstreportMenu.Text += "<li><a>" + dt.Rows[i]["CategoryName"].ToString() + "<span class='fa fa-chevron-down'> </span></a><ul class='nav child_menu' style='display: none'>";

                    //}

                    //if (cat != dt.Rows[i]["CategoryId"].ToString())
                    //{

                    //    lstreportMenu.Text += " </ul></li>";
                    //    cat = dt.Rows[i]["CategoryId"].ToString();
                    //lstreportMenu.Text += "<li><a>" + dt.Rows[i]["CategoryName"].ToString() + "<span class='fa fa-chevron-down'> </span></a><ul class='nav child_menu' style='display: none'>";
                    lstreportMenu.Text += "  <li><a href='" + "../../Support/CMS/" + dt.Rows[i]["MenuLink"].ToString() + "?id=" + generaterandomstr(8) + "@A" + dt.Rows[i]["MenuId"].ToString() + "-" + generaterandomstr(8) + "'><span>" + dt.Rows[i]["MenuName"].ToString() + "</span></a></li>";
                    //}
                    //else
                    //    lstreportMenu.Text += "  <li><a href='" + "../../Support/CMS/" + dt.Rows[i]["MenuLink"].ToString() + "?id=" + generaterandomstr(8) + "@A" + dt.Rows[i]["MenuId"].ToString() + "-" + generaterandomstr(8) + "'><span>" + dt.Rows[i]["MenuName"].ToString() + "</span></a></li>";
                }
                //for (int i = 0; i < dt.Rows.Count; i++)
                //{
                //    dr = dtmenu.NewRow();
                //    dr["MenuLink"] = dt.Rows[i]["MenuLink"].ToString();
                //    dr["icon"] = dt.Rows[i]["icon"].ToString();
                //    dr["MenuName"] = dt.Rows[i]["MenuName"].ToString();
                //    dr["linkCode"] = generaterandomstr(11) + "@A" + dt.Rows[i]["MenuId"].ToString() + "-" + generaterandomstr(2);
                //    dtmenu.Rows.Add(dr);
                //}
                //lstreportMenu.DataSource = dtmenu;
                //lstreportMenu.DataBind();
            }
        }
コード例 #11
0
ファイル: Transfer.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 确认交接
        /// </summary>
        private void Btn_Transfer_Click(object sender, EventArgs e)
        {
            if (PassValue.IsPrintshifts == false)
            {
                MessageBox.Show("请先打印交接班单!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }

            Shift shift = new Shift();

            shift.end = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace(' ', 'T');
            Employee cashier = new Employee();

            cashier.id    = PassValue.shiftId;
            shift.cashier = cashier;

            HttpResult httpResult = httpReq.HttpPatch(string.Format("shifts/{0}", PassValue.shiftId), shift);

            if ((int)httpResult.StatusCode == 0)
            {
                MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            if ((int)httpResult.StatusCode >= 200 && (int)httpResult.StatusCode < 300)
            {
                MessageBox.Show("交接成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                httpResult = httpReq.HttpDelete(string.Format("auth/tokens/{0}", PassValue.tokenid));
                if ((int)httpResult.StatusCode == 0)
                {
                    MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }

                string path = Application.StartupPath + @"/点菜100.exe";
                System.Diagnostics.Process.Start(path);
                Application.Exit();
            }
            else if ((int)httpResult.StatusCode == 401)
            {
                LoginBusiness lg = new LoginBusiness();
                lg.LoginAgain();
                return;
            }
            else
            {
                if ((int)httpResult.StatusCode == 403)
                {
                    MessageBox.Show("有反结算账单未结算,请结算!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    MessageBox.Show("未知错误!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
        }
コード例 #12
0
 public BaseController() : base()
 {
     loginBusiness       = new LoginBusiness(this.GetContext());
     userBusiness        = new UserBusiness(this.GetContext());
     categoryBusiness    = new CategoryBusiness(this.GetContext());
     servicePlanBusiness = new ServicePlanBusiness(this.GetContext());
     newsBusiness        = new NewsBusiness(this.GetContext());
     customerBusiness    = new CustomerBusiness(this.GetContext());
     orderBusiness       = new OrderBusiness(this.GetContext());
     customerServicePlan = new CustomerServicePlanBusiness(this.GetContext());
 }
コード例 #13
0
        public ActionResult GetBeneType()
        {
            var _loginBuss = new LoginBusiness();
            var Data       = _loginBuss.GetBeneType();

            ViewBag.BeneType = Data.AsEnumerable().Select(m => new SelectListItem()
            {
                Text = m.BeneType, Value = m.BeneTypeID.ToString()
            });
            return(View());
        }
コード例 #14
0
        public ActionResult GetUserMail(string Username)
        {
            var _loginBuss = new LoginBusiness();
            var Data       = _loginBuss.GetUserMail(Username);

            if (Data == null)
            {
                Data = "";
            }
            return(Json(Data, JsonRequestBehavior.AllowGet));
        }
コード例 #15
0
    public string login(string user, string pass)
    {
        string conectionString = WebConfigurationManager.ConnectionStrings["2017_sistema_camel"].ConnectionString;
        Login  login           = new Login();

        login.Usuario = user;
        login.Clave   = pass;
        LoginBusiness loginBusiness = new LoginBusiness(conectionString);
        string        resultado     = loginBusiness.validarEncargado(user, pass);

        return(resultado);
    }
コード例 #16
0
ファイル: OpenTables.cs プロジェクト: zhuqinliang/Client
        public void OpenDesk()
        {
            if (!string.IsNullOrEmpty(this.numericUpDown1.Text))
            {
                if (Int32.Parse(this.numericUpDown1.Text) > 0)
                {
                    Desk d;
                    d = (Desk)this.Owner;

                    string[]    tables = PassValue.desk;
                    Consumption cp     = new Consumption();
                    int         count  = tables.Count();
                    cp.tables = new Table[count];
                    for (int i = 0; i < count; i++)
                    {
                        cp.tables[i]    = new Table();
                        cp.tables[i].id = tables[i];
                    }
                    cp.people = int.Parse(this.numericUpDown1.Text.ToString());

                    HttpResult httpResult = httpReq.HttpPost("consumptions", cp);
                    if ((int)httpResult.StatusCode == 409)
                    {
                        d.CurrentChooseDesk.Clear();
                        MessageBox.Show("有桌子已被操作,请重新选择!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                    else if ((int)httpResult.StatusCode == 401)
                    {
                        LoginBusiness lg = new LoginBusiness();
                        lg.LoginAgain();
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 0)
                    {
                        MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }


                    d.Refresh_Method();
                    d.ChooseCurrent();
                    this.Close();
                    PassValue.count_select_idle     = 0;//被选中的桌子数量为0
                    PassValue.count_select_ordering = count;
                    PassValue.selectedtableid.Clear();
                    this.DialogResult = DialogResult.OK;
                }
                else if (Int32.Parse(this.numericUpDown1.Text) == 0)
                {
                    MessageBox.Show("开桌人数不能为0!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
        }
コード例 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[sessionNames.userID_StudentOstad] == null)
            {
                Response.Redirect("~/CommonUI/login.aspx");
            }

            if (Session[sessionNames.userID_StudentOstad] != null)
            {
                Label1.Text = Session[sessionNames.userID_StudentOstad].ToString();
                if (!IsPostBack)
                {
                    LoginBusiness lgnB = new LoginBusiness();
                    StuImg        st   = lgnB.User_Img(Label1.Text);
                    PersonalImg.DataValue = st.img;
                    LoginDTO stInfo = lgnB.Get_StInfo(Label1.Text);
                    stName.InnerText     = stInfo.Name;
                    stLastName.InnerText = stInfo.LastName;
                    stField.InnerText    = stInfo.StReshte;
                    Reports rpt = new Reports();
                    List <ReportDownloadReqDTO> counter = new List <ReportDownloadReqDTO>();
                    int sum = 0;
                    counter = rpt.Get_SelectedAsset_NotPay(Label1.Text);
                    ShoppingCounter.InnerText = counter.Count.ToString();
                    grdShopping.DataSource    = counter;
                    grdShopping.DataBind();
                    DownloadRequestBusiness dnlB     = new DownloadRequestBusiness();
                    List <AssetDTO>         assetlst = new List <AssetDTO>();
                    assetlst = dnlB.GetValidAssets(Label1.Text);
                    if (assetlst.Count > 0)
                    {
                        dnlNav.Visible = true;
                    }
                    if (grdShopping.MasterTableView.Items.Count > 0)
                    {
                        Paybtn.Visible = true;
                    }
                    foreach (GridDataItem item in grdShopping.MasterTableView.Items)
                    {
                        if (grdShopping.Columns[2].UniqueName == "SumPrice")
                        {
                            sum += int.Parse(item["SumPrice"].Text.Replace(",", ""));
                        }
                    }
                    Session["Fee"] = sum.ToString();
                }
                Session[sessionNames.userID_StudentOstad] = Label1.Text;
            }
            else
            {
                Response.Redirect("~/CommonUI/login.aspx", false);
            }
        }
コード例 #18
0
ファイル: OpenTables.cs プロジェクト: zhuqinliang/Client
        public void OpenDesk()
        {
            if (!string.IsNullOrEmpty(this.numericUpDown1.Text))
            {
                if (Int32.Parse(this.numericUpDown1.Text) > 0)
                {
                    Desk d;
                    d = (Desk)this.Owner;

                    string[] tables = PassValue.desk;
                    Consumption cp = new Consumption();
                    int count = tables.Count();
                    cp.tables = new Table[count];
                    for (int i = 0; i < count; i++)
                    {
                        cp.tables[i] = new Table();
                        cp.tables[i].id = tables[i];
                    }
                    cp.people = int.Parse(this.numericUpDown1.Text.ToString());

                    HttpResult httpResult = httpReq.HttpPost("consumptions", cp);
                    if ((int)httpResult.StatusCode == 409)
                    {
                        d.CurrentChooseDesk.Clear();
                        MessageBox.Show("有桌子已被操作,请重新选择!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                    else if ((int)httpResult.StatusCode == 401)
                    {
                        LoginBusiness lg = new LoginBusiness();
                        lg.LoginAgain();
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 0)
                    {
                        MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }

                    d.Refresh_Method();
                    d.ChooseCurrent();
                    this.Close();
                    PassValue.count_select_idle = 0;//被选中的桌子数量为0
                    PassValue.count_select_ordering = count;
                    PassValue.selectedtableid.Clear();
                    this.DialogResult = DialogResult.OK;
                }
                else if (Int32.Parse(this.numericUpDown1.Text) == 0)
                {
                    MessageBox.Show("开桌人数不能为0!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
        }
コード例 #19
0
ファイル: frmLogin.cs プロジェクト: Leeyoonsung86/LeesSpace
        //시스템 로그인
        private void _btLoginOk_Click(object sender, EventArgs e)
        {
            //pLoginEntity.CORP_CODE = Properties.Settings.Default.CORP_CODE.ToString();
            pLoginEntity.USER_CODE = _txtAccount.Text.ToString();
            pLoginEntity.USER_PASS = CoFAS_AES256Encrypt.EncryptToString(_txtPassword.Text.ToString(), "COEVER", saltBytes, false); // 암호화



            DataTable dtLoginInfo = new LoginBusiness().Login_Info(pLoginEntity.USER_CODE, pLoginEntity.USER_PASS);

            //DataTable dtLoginInfo = new LoginBusiness().Login_Info(pLoginEntity.CORP_CODE, pLoginEntity.USER_CODE, pLoginEntity.USER_PASS);
            if (dtLoginInfo == null || dtLoginInfo.Rows.Count == 0)
            {
                CoFAS_DevExpressManager.ShowInformationMessage(_msgLoginMessage);

                _txtPassword.Focus();
                _txtPassword.Select();
                return;
            }
            else
            {
                //pUserEntity.CORP_CODE = dtLoginInfo.Rows[0]["CORP_CODE"].ToString();
                pUserEntity.CORP_NAME  = dtLoginInfo.Rows[0]["CORP_NAME"].ToString();
                pUserEntity.USER_CODE  = dtLoginInfo.Rows[0]["USER_ACCOUNT"].ToString();
                pUserEntity.USER_NAME  = dtLoginInfo.Rows[0]["USER_NAME"].ToString();
                pUserEntity.USER_GRANT = dtLoginInfo.Rows[0]["USER_GRANT"].ToString();

                if (_ckUserIDSave.EditValue.ToString() == "Y")
                {
                    Properties.Settings.Default.USER_ID      = pUserEntity.USER_CODE.ToString();
                    Properties.Settings.Default.USER_ID_SAVE = "Y";
                }
                else
                {
                    Properties.Settings.Default.USER_ID      = "";
                    Properties.Settings.Default.USER_ID_SAVE = "N";
                }

                Properties.Settings.Default.Save();

                //frmMain pMain = new frmMain(pUserEntity);
                //듀얼모니터에서 실행위치 보내기
                frmMain pMain = new frmMain(pUserEntity, GetCurrnetMonitor());

                //pMain.Show();
                Hide();
                pMain.ShowDialog();
                _txtPassword.Text = "";
                Show();
                _txtPassword.Focus();
            }
        }
コード例 #20
0
        public virtual async Task <Execute <string> > SignUp([FromBody] SignUpEntity signUpEntity)
        {
            var signUp = await LoginBusiness.SignUpAsync(signUpEntity);

            var result = new Execute <string>(signUp);

            if (!result.HasErro)
            {
                result.Entity = TicketManager.WriteToken(signUp.Entity);
            }

            return(result);
        }
コード例 #21
0
ファイル: LoginController.cs プロジェクト: jiaozhanjing/Trace
        /// <summary>
        /// 普通登陆
        /// </summary>
        /// <param name="_"></param>
        /// <returns></returns>
        public string NormalLogin(dynamic _)
        {
            //接收request数据
            var recdata = this.GetResquetData <LoginInModel>();

            // WriteInfoLog("LoginModule", recdata.data.LoginName, recdata.DeviceId, "登陆成功123123123123123!");
            try
            {
                #region "接口调用验证"
                //bool flag = DataValidation(recdata.DateTime, recdata.Random, recdata.Sign);

                //if (!flag)
                //{
                //    return this.WriteValidationLog("LoginModule", recdata.DeviceId);
                //}
                #endregion

                LoginBusiness bl       = new LoginBusiness();
                LoginOutModel UserInfo = bl.NormalLogin(recdata.data.LoginName);

                int TokenTime = Convert.ToInt32(ConfigurationManager.AppSettings["TOKEN_TIME"]);
                if (UserInfo != null)
                {
                    if (UserInfo.State == 1)
                    {
                        return(SendData("账户已注销!", ResponseType.Fail));
                    }
                    else if (UserInfo.Password != recdata.data.Password)
                    {
                        return(SendData("密码不正确!", ResponseType.Fail));
                    }
                    else
                    {
                        //记录token
                        this.WriteCache(UserInfo.Token, UserInfo.SessionId, TokenTime);

                        WriteInfoLog("LoginModule", recdata.data.LoginName, recdata.DeviceId, "登陆成功!");

                        return(this.SendData <LoginOutModel>(UserInfo, "登陆成功", ResponseType.Success));
                    }
                }
                else
                {
                    return(SendData("账户不存在!", ResponseType.Fail));
                }
            }
            catch (Exception ex)
            {
                return(this.WriteExceptionLog("LoginModule", recdata.data.LoginName, recdata.DeviceId, "登陆异常:" + Json.ToJson(recdata) + "[异常信息:" + ex.Message + "]", "登陆异常:" + ex.Message));
            }
        }
コード例 #22
0
        public ActionResult CheckValidUserName(string Name)
        {
            var _loginBuss = new LoginBusiness();
            var Data       = _loginBuss.CheckValidUserName(Name);

            if (Data == null)
            {
                return(Json(1, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(0, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #23
0
        public async Task <IActionResult> PostLogInCustomer(LoginEntity model)
        {
            LoginBusiness loginBusiness = new LoginBusiness();
            var           response      = loginBusiness.LogInCustomer(_context, _config, model);

            if (response.Error == false)
            {
                return(Ok(response));
            }
            else
            {
                return(BadRequest(response));
            }
        }
コード例 #24
0
        public async Task <IActionResult> PostRegisterAutoridad(AutoridadEntity model)
        {
            LoginBusiness loginBusiness = new LoginBusiness();
            var           response      = loginBusiness.RegisterAutoridad(_context, model);

            if (response.Error == false)
            {
                return(Ok(response));
            }
            else
            {
                return(BadRequest(response));
            }
        }
        public static string BtnLinkTesti6(string userId, string userName)
        {
            LoginBusiness lgb = new LoginBusiness();

            var userAdobe = userId;

            DataTable dtuserRoles = lgb.Get_UserRoles(userAdobe);
            string    firtsName   = userName;
            string    lastName    = dtuserRoles.Rows[0]["RoleName"].ToString();

            adobeConnectDTO.SetValueDefult(userAdobe, passAdobeUser, firtsName, lastName);
            adobeConnectDTO.MeetingUrlPath = "/st99900999_13981107_6";    //name.Text;
            return("http://" + adobeBusiness.OpenMeetingAsHost(adobeConnectDTO));
        }
コード例 #26
0
 protected void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         LoginBusiness loginBusiness = new LoginBusiness(txbUserName.Text, txbPassword.Text);
         loginBusiness.LoginUser();
         Response.Redirect("~/Default.aspx");
     }
     catch (Exception ex)
     {
         ResponseMessage message = new ResponseMessage();
         message.PrintFailureMessage(spnMessage, ex.Message);
     }
 }
コード例 #27
0
ファイル: Login.aspx.cs プロジェクト: syobox64/InternShip2019
        //「ログイン」ボタンを押下した時の処理
        protected void Button_Click(object sender, EventArgs e)
        {
            error1.Visible = false;


            // ログイン内容を保持するオブジェクトのインスタンスを生成
            LoginEntity loginEntity = new LoginEntity();

            // 「ログインID」欄が未入力だった時の処理
            if (!TextBox1.Text.Trim().Equals(""))
            {
                // ログイン内容をresultEntityのメンバに格納
                loginEntity.LoginName = TextBox1.Text;
            }
            else
            {
                // エラーメッセージを表示する
                error1.Visible = true;
            }

            // エラーメッセージが表示されていない = 入力欄に不備が無い
            if (!error1.Visible)
            {
                // ログイン画面のBusinessLogic(計算・加工処理・実施)のインスタンス applicationBusiness を生成
                LoginBusiness loginBusiness = new LoginBusiness();

                // applicationBusinessの申し込み結果の登録ロジック ApplicationRegistration に resultEntity を渡し実行
                loginBusiness.LoginRegistration(loginEntity);
                var table = loginBusiness.Select(loginEntity);
                if (table.Rows.Count != 0) //入力した人が存在している
                {
                    string test = (string)table.Rows[0][1];


                    string textValue = TextBox1.Text;

                    //セッションに値格納
                    Session["id"] = textValue;

                    //var a = (string)Session["id"];//設定した値によってキャストが必要
                    //Label2.Text = a;



                    // トップページへ遷移する
                    Response.Redirect("./Top.aspx");
                }
            }
        }
コード例 #28
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string    serverUrl    = string.Empty;
            string    userName     = string.Empty;
            string    password     = string.Empty;
            string    databaseName = string.Empty;
            Hashtable htAtt        = new Hashtable();
            Hashtable htSubNode    = new Hashtable();

            if (_rememberInfo)
            {
                serverUrl    = txtServerUrl.Text.Trim();
                userName     = txtLoginName.Text.Trim();
                password     = txtPassword.Text.Trim();
                databaseName = txtDatabase.Text.Trim();
                if (!File.Exists(filename))
                {
                    xml.CreateXmlDocument(filename, "SystemInfo", "UTF-8");
                    htSubNode.Add("ServerUrl", SelfEncrtpt(serverUrl));
                    htSubNode.Add("UserName", SelfEncrtpt(userName));
                    htSubNode.Add("Password", SelfEncrtpt(password));
                    htSubNode.Add("DatabaseName", SelfEncrtpt(databaseName));
                    htSubNode.Add("Remember", cbRemember.Checked);
                    xml.InsertNode(filename, "UserInfo", false, "SystemInfo", htAtt, htSubNode);
                }
                else
                {
                    _xmlNodeList = xml.GetXmlNodeListByXpath(filename, "SystemInfo");
                }
            }
            resultInfo.Result = false;
            if (_userInfo != null)
            {
                SystemConfig config = new SystemConfig(serverUrl, userName, password, databaseName);
                MyLogin    = new LoginBusiness(ProviderType.SqlServer);
                resultInfo = MyLogin.Login(userName, password);
            }

            if (resultInfo.Result)
            {
                MessageBox.Show("系统登录成功!");
                DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show(resultInfo.Info);
                DialogResult = DialogResult.No;
            }
        }
コード例 #29
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            LoginDTO      dadosLogin    = new LoginDTO();
            LoginBusiness loginBusiness = new LoginBusiness();

            dadosLogin.User  = txtUserLogin.Text.Trim();
            dadosLogin.Senha = txtSenha.Text.Trim();

            if (loginBusiness.ValidarLogin(dadosLogin))
            {
                FrmPainelADM adm = new FrmPainelADM();
                adm.nomeUser = dadosLogin.User;
                adm.Show();
            }
        }
コード例 #30
0
        public async Task <IActionResult> PostRegisterCustomer(CustomerEntity model)
        {
            LoginBusiness loginBusiness = new LoginBusiness();
            var           response      = loginBusiness.RegisterCustomer(_context, model);

            if (response.Error == false)
            {
                await _emailSender.SendEmailAsync(model.Email, "Información de registro", $"Gracias por haberse registrado en nuestra aplicación sus datos son : Nombre de usuario : {model.Username} , Correo : {model.Email}, # de celular : {model.Phone}");

                return(Ok(response));
            }
            else
            {
                return(BadRequest(response));
            }
        }
コード例 #31
0
        public Task <Login> FindByIdAsync(string userId, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            if (String.IsNullOrWhiteSpace(this._connectionOpt.DataSource))
            {
                LoginBusiness loginBll = new LoginBusiness(this._connectionOpt);

                return(Task.FromResult <Login>(null));
            }
            else
            {
                LoginBusiness loginBll = new LoginBusiness(this._connectionOpt);

                return(Task.FromResult(loginBll.ObterPorIDs(new object[] { int.Parse(userId) })));
            }
        }
コード例 #32
0
ファイル: BaseProvider.cs プロジェクト: umfaruki/XCommon
        public async Task ProcessTicket(OAuthCreatingTicketContext ctx)
        {
            var signUpExternal = ParseExternalEntity(ctx);
            var ticket         = await LoginBusiness.SignUpAsync(signUpExternal);

            if (ticket.HasErro || ticket.Entity.Status != TicketStatus.Sucess)
            {
                await ctx.HttpContext.SignOutAsync();

                ctx.Response.Redirect(AuthenticationConfig.UriError);
                return;
            }

            var tokenKey = await TicketManager.SignInAsync(ticket.Entity);

            throw new Exception($"{RedirectKey}|{tokenKey}");
        }
コード例 #33
0
        public void ObterDadosVersao_TestaVersaoAtualizada_VersaoValidaAtualizada()
        {
            var mockCliente     = Substitute.For <IClienteEntity>();
            var mockFuncionario = Substitute.For <IFuncionarioData>();
            var mockAluno       = Substitute.For <IAlunoEntity>();
            var mockPerfil      = Substitute.For <IPerfilAlunoData>();
            var mockVersao      = Substitute.For <IVersaoAppPermissaoEntityData>();

            mockVersao.GetUltimaVersaoBloqueada((int)Aplicacoes.Recursos).Returns("1.0.0");
            var business = new LoginBusiness(mockCliente, mockAluno, mockFuncionario, mockPerfil, mockVersao, null, null, null);

            var resultVersaoIgual = business.ObterDadosVersao("1.2.1", "1.2.1", Aplicacoes.Recursos);

            Assert.AreEqual(true, resultVersaoIgual.VersaoValida);
            Assert.AreEqual(true, resultVersaoIgual.VersaoAtualizada);
            Assert.IsFalse(string.IsNullOrEmpty(resultVersaoIgual.NumeroUltimaVersao));
        }
コード例 #34
0
ファイル: Transfer.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 打印交接单
        /// </summary>
        private void Btn_Print_Click(object sender, EventArgs e)
        {
            this.lbMessage.Text = "正在打印请稍后。。。";
            Application.DoEvents();
            Task task = new Task();

            task.kind = "shift";
            Shift shift = new Shift();

            shift.id   = PassValue.shiftId;
            task.shift = shift;

            HttpResult httpResult = httpReq.HttpPost("printing/tasks", task);

            if ((int)httpResult.StatusCode == 401)
            {
                this.lbMessage.Text = "";
                LoginBusiness lg = new LoginBusiness();
                lg.LoginAgain();
                return;
            }
            else if ((int)httpResult.StatusCode == 0)
            {
                MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }

            if ((int)httpResult.StatusCode >= 200 && (int)httpResult.StatusCode < 300)
            {
                MessageBox.Show("打印成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                if ((int)httpResult.StatusCode == 410)
                {
                    MessageBox.Show("请检查打印机是否连接!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    MessageBox.Show("未知错误!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
            PassValue.IsPrintshifts = true;
            this.lbMessage.Text     = "";
        }
コード例 #35
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        HttpCookie loginCookie = Request.Cookies["UserSettings"];

        if (loginCookie == null)
        {
            loginCookie = new HttpCookie("UserSettings");
        }

        LoginBusiness lb = new LoginBusiness();
        User loginUser = new User();
        loginUser.Email = TextBoxEmailIncomingUser.Text;
        loginUser.Password = TextBoxPasswordIncomingUser.Text;

        if (lb.ValidateUser(loginUser) == null)
        {

            Session["USER"] = lb.GetUser(loginUser);
            Response.Redirect("index.aspx");

            if (CheckBoxRememberIncomingUser.Checked)
            {
                loginCookie["Email"] = loginUser.Email;
                loginCookie["Password"] = loginUser.Password;
                loginCookie.Expires = DateTime.Now.AddDays(30d);
                Response.Cookies.Add(loginCookie);
            }
            else
            {
                loginCookie.Expires = DateTime.Now.AddDays(-1d);
                Response.Cookies.Add(loginCookie);
            }

        }
        else
        {
            LabelError.Text = lb.ValidateUser(loginUser);

        }
    }
コード例 #36
0
ファイル: PlanOrder.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 确认提交方法
        /// </summary>
        public void button_ok()
        {
            foreach (Control ctl in this.flowLayoutPanel1.Controls)
            {
                if (ctl is CheckBox && ((CheckBox)ctl).Checked)
                {
                    PassValue.Percent = Int32.Parse(ctl.Tag.ToString());
                    if (PassValue.Percent != 0)
                    {
                        Discount ds = new Discount();
                        ds.type = "scheme";
                        ds.scheme = new Scheme();
                        ds.scheme.id=ctl.Name;
                        ds.scheme.percent=PassValue.Percent;
                        PassValue.discounts.Add(ds);
                        PassValue.Infor_payment.discounts = new Discount[PassValue.discounts.Count];
                    }
                    int i = 0;
                    foreach (Discount ds in PassValue.discounts)
                    {
                        PassValue.Infor_payment.discounts[i++] = ds;
                    }
                }
            }

            HttpResult httpResult = httpReq.HttpPatch(string.Format("consumptions/{0}", planConsumptionid), PassValue.Infor_payment);
            if ((int)httpResult.StatusCode == 401)
            {
                LoginBusiness lg = new LoginBusiness();
                lg.LoginAgain();
                return;
            }
            else if ((int)httpResult.StatusCode == 0)
            {
                MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            Form_Esc();
        }
コード例 #37
0
ファイル: FreeOrder.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 确认提交方法
        /// </summary>
        public void button_ok()
        {
            if (this.TxtDiscount.Text != "")
            {
                Consumption personsConsumption = httpReq.HttpGet<Consumption>(string.Format("consumptions/{0}", freeConsumptionsid));

                string price_fixed = double.Parse(this.TxtDiscount.Text).ToString("0.00");
                if (price_fixed != "0.00")//判断不能为0
                {
                    if (personsConsumption.discounts != null)
                    {
                        PassValue.discounts = personsConsumption.discounts.ToList();
                        PassValue.discounts.Remove(PassValue.discounts.Where(d => d.type.ToLower() == "free").FirstOrDefault());
                    }

                    Discount ds = new Discount();
                    ds.type = "free";
                    ds.amount = price_fixed;
                    PassValue.discounts.Add(ds);
                    PassValue.Infor_payment.discounts = PassValue.discounts.ToArray();
                }

                HttpResult httpResult = httpReq.HttpPatch(string.Format("consumptions/{0}", freeConsumptionsid), PassValue.Infor_payment);
                if ((int)httpResult.StatusCode == 401)
                {
                    LoginBusiness lg = new LoginBusiness();
                    lg.LoginAgain();
                    return;
                }
                else if ((int)httpResult.StatusCode == 0)
                {
                    MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }
                Form_Esc();
            }
        }
コード例 #38
0
ファイル: Transfer.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 确认交接
        /// </summary>
        private void Btn_Transfer_Click(object sender, EventArgs e)
        {
            if (PassValue.IsPrintshifts == false)
            {
                MessageBox.Show("请先打印交接班单!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }

            Shift shift = new Shift();
            shift.end = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace(' ', 'T');
            Employee cashier = new Employee();
            cashier.id = PassValue.shiftId;
            shift.cashier = cashier;

            HttpResult httpResult = httpReq.HttpPatch(string.Format("shifts/{0}", PassValue.shiftId), shift);
            if ((int)httpResult.StatusCode == 0)
            {
                MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            if ((int)httpResult.StatusCode >= 200 && (int)httpResult.StatusCode < 300)
            {
                MessageBox.Show("交接成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                httpResult = httpReq.HttpDelete(string.Format("auth/tokens/{0}", PassValue.tokenid));
                if ((int)httpResult.StatusCode == 0)
                {
                    MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }

                string path = Application.StartupPath + @"/点菜100.exe";
                System.Diagnostics.Process.Start(path);
                Application.Exit();
            }
            else if ((int)httpResult.StatusCode == 401)
            {
                LoginBusiness lg = new LoginBusiness();
                lg.LoginAgain();
                return;
            }
            else
            {
                if ((int)httpResult.StatusCode == 403)
                {
                    MessageBox.Show("有反结算账单未结算,请结算!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    MessageBox.Show("未知错误!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
        }
コード例 #39
0
ファイル: Member.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 打印对账单
        /// </summary>
        private void Btn_Print_Click(object sender, EventArgs e)
        {
            Task task = new Task();
            task.kind = "bill";
            Consumption consumption = new Consumption();
            consumption.id = PassValue.consumptionid;
            task.consumption = consumption;

            HttpResult httpResult = httpReq.HttpPost("printing/tasks", task);

            if ((int)httpResult.StatusCode >= 200 && (int)httpResult.StatusCode < 300)
            {
                MessageBox.Show("打印成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else if ((int)httpResult.StatusCode == 401)
            {
                LoginBusiness lg = new LoginBusiness();
                lg.LoginAgain();
                return;
            }
            else if ((int)httpResult.StatusCode == 0)
            {
                MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            else if ((int)httpResult.StatusCode == 410)
            {
                MessageBox.Show("请确定连接打印机!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            else
            {
                MessageBox.Show("打印失败!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
        }
コード例 #40
0
ファイル: Transfer.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 打印交接单
        /// </summary>
        private void Btn_Print_Click(object sender, EventArgs e)
        {
            this.lbMessage.Text = "正在打印请稍后。。。";
            Application.DoEvents();
            Task task = new Task();
            task.kind = "shift";
            Shift shift = new Shift();
            shift.id =PassValue.shiftId;
            task.shift = shift;

            HttpResult httpResult = httpReq.HttpPost("printing/tasks", task);
            if ((int)httpResult.StatusCode == 401)
            {
                this.lbMessage.Text = "";
                LoginBusiness lg = new LoginBusiness();
                lg.LoginAgain();
                return;
            }
            else if ((int)httpResult.StatusCode == 0)
            {
                MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }

            if ((int)httpResult.StatusCode >= 200 && (int)httpResult.StatusCode < 300)
            {
                MessageBox.Show("打印成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                if ((int)httpResult.StatusCode == 410)
                {
                    MessageBox.Show("请检查打印机是否连接!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    MessageBox.Show("未知错误!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
            PassValue.IsPrintshifts = true;
            this.lbMessage.Text = "";
        }
コード例 #41
0
ファイル: Member.cs プロジェクト: zhuqinliang/Client
        /// <summary>
        /// 确认按钮
        /// </summary>
        private void Btn_Enter_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确认结账吗?", "订单操作", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                var personsConsumption = httpReq.HttpGet<Consumption>(string.Format("consumptions/{0}", PassValue.consumptionid));

                //实收金额
                string price_fixed = this.lbReceiveActual.Text;
                //应收金额
                string total = this.lbTotal.Text;
                PassValue.Infor_payment.paid = PassValue.Infor_payment.closed = true;
                PassValue.Infor_payment.payments = PassValue.payments.ToArray();
                PassValue.Infor_payment.discounts = personsConsumption.discounts;
                if (double.Parse(total) - double.Parse(price_fixed) <= 0.00)
                {
                    //判断有没有支付信息
                    if (PassValue.payments.Count() == 0)
                    {
                        MessageBox.Show("请输入支付信息,您不能结账,如支付金额为0,请选择其他?", "订单操作", MessageBoxButtons.OK, MessageBoxIcon.Question);
                        return;
                    }
                    else
                    {
                        //判断支付信息有没有会员卡信息
                        Payment payment = PassValue.payments.Where(payments => payments.method.Equals("member")).FirstOrDefault();
                        if (payment != null)
                        {
                            //弹出密码输入框
                            InputPassWord ip = new InputPassWord();
                            if (ip.ShowDialog() == DialogResult.Cancel)
                            {
                                return;
                            }
                        }
                    }

                    HttpResult httpResult = httpReq.HttpPatch(string.Format("consumptions/{0}", PassValue.consumptionid), PassValue.Infor_payment);
                    if ((int)httpResult.StatusCode == 410)
                    {
                        MessageBox.Show("请检查打印机是否连接!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                    else if ((int)httpResult.StatusCode == 401)
                    {
                        LoginBusiness lg = new LoginBusiness();
                        lg.LoginAgain();
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 0)
                    {
                        MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 403)
                    {
                        MessageBox.Show("操作被禁止!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 500)
                    {
                        MessageBox.Show("操作错误(500)!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 400)
                    {
                        MessageBox.Show("请求错误(400)!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }

                    PassValue.Infor_payment = new PatchOrders();
                    PassValue.discounts.Clear();
                    PassValue.payments.Clear();//清空
                    Messagebox mb = new Messagebox();
                    PassValue.MessageInfor = "结账完成";
                    mb.ShowDialog();
                    PassValue.consumptionid = "";
                    PassValue.MemberCardPwd = "";
                    PassValue.listItemID.Clear();
                    PassValue.listItemIDBefore.Clear();
                    PassValue.Percent = 0;

                    Desk d = this.Owner as Desk;
                    if (d == null)
                    {
                        if (m_ILoadData != null)
                        {
                            m_ILoadData.LoadData();
                        }
                    }
                    else
                    {
                        d.CurrentChooseDesk.Clear();
                        d.Refresh_Method();
                        d.CurrentChooseDesk = new Dictionary<string, string>();
                    }

                    this.Close();
                }
                else
                {
                    PassValue.MessageInfor = "应收金额:" + this.lbTotal.Text + "实际结账的金额是:" + this.lbReceiveActual.Text + ",您不能结账!";
                    MessageBox.Show(PassValue.MessageInfor);
                }
            }
        }
コード例 #42
0
ファイル: Member.cs プロジェクト: zhuqinliang/Client
        public void addorderclose_Click(object sender, EventArgs e)
        {
            SetUp();
            var personsConsumption = httpReq.HttpGet<Consumption>(string.Format("consumptions/{0}", PassValue.consumptionid));

            PassValue.discounts.Clear();
            PassValue.Infor_payment = new PatchOrders();
            if (personsConsumption.discounts != null)
            {
                PassValue.discounts = personsConsumption.discounts.ToList();
            }
            Discount discount = new Discount();
            Payment payment = new Payment();
            LineControl.LineControl lclc = ((PictureBox)sender).Parent as LineControl.LineControl;
            switch (lclc.lbInformation.Text.Split(':')[0].Trim())
            {
                case "整单打折":
                    discount = personsConsumption.discounts.Where(persons => persons.type.Equals("whole")).FirstOrDefault();
                    PassValue.discounts.Remove(discount);
                    this.Btn_Part.Enabled = this.Btn_Plan.Enabled = this.Btn_Part.Enabled = this.Btn_Fixed.Enabled = true;
                    break;
                case "部分打折":
                    discount = personsConsumption.discounts.Where(persons => persons.type.Equals("partial")).FirstOrDefault();
                    PassValue.discounts.Remove(discount);
                    this.Btn_Part.Enabled = this.Btn_Plan.Enabled = this.Btn_Part.Enabled = this.Btn_Fixed.Enabled = true;
                    PassValue.listItemID.Clear();
                    PassValue.listItemIDBefore.Clear();
                    PassValue.Percent = 0;
                    break;
                case "方案打折":
                    discount = personsConsumption.discounts.Where(persons => persons.type.Equals("scheme")).FirstOrDefault();
                    PassValue.discounts.Remove(discount);
                    this.Btn_Part.Enabled = this.Btn_Plan.Enabled = this.Btn_Part.Enabled = this.Btn_Fixed.Enabled = true;
                    break;
                case "定额打折":
                    discount = personsConsumption.discounts.Where(persons => persons.type.Equals("quota")).FirstOrDefault();
                    PassValue.discounts.Remove(discount);
                    this.Btn_Part.Enabled = this.Btn_Plan.Enabled = this.Btn_Part.Enabled = this.Btn_Fixed.Enabled = true;
                    break;
                case "抹零":
                    discount = personsConsumption.discounts.Where(persons => persons.type.Equals("round")).FirstOrDefault();
                    PassValue.discounts.Remove(discount);
                    this.Btn_Part.Enabled = this.Btn_Plan.Enabled = this.Btn_Part.Enabled = this.Btn_Fixed.Enabled = true;
                    break;
                case "免单":
                    discount = personsConsumption.discounts.Where(persons => persons.type.Equals("free")).FirstOrDefault();
                    PassValue.discounts.Remove(discount);
                    this.Btn_Part.Enabled = this.Btn_Plan.Enabled = this.Btn_Part.Enabled = this.Btn_Fixed.Enabled = true;
                    break;

                case "银联卡":
                    payment = PassValue.payments.Where(payments => payments.method.Equals("bankcard")).FirstOrDefault();
                    PassValue.payments.Remove(payment);
                    PassValue.Price_Now = (double.Parse(this.lbTotal.Text) + double.Parse(payment.amount)).ToString("0.00"); //应付价格传递给全局变量
                    Price_Recive = Price_Recive - double.Parse(payment.amount);
                    this.lbReceiveActual.Text = Price_Recive.ToString();
                    break;
                case "现金支付":
                    payment = PassValue.payments.Where(payments => payments.method.Equals("cash")).FirstOrDefault();
                    PassValue.payments.Remove(payment);
                    PassValue.Price_Now = (double.Parse(this.lbTotal.Text) + double.Parse(payment.amount)).ToString("0.00"); //应付价格传递给全局变量
                    Price_Recive = Price_Recive - double.Parse(payment.amount);
                    this.lbReceiveActual.Text = Price_Recive.ToString();
                    break;
                case "会员卡":
                    payment = PassValue.payments.Where(payments => payments.method.Equals("member")).FirstOrDefault();
                    PassValue.payments.Remove(payment);
                    PassValue.Price_Now = (double.Parse(this.lbTotal.Text) + double.Parse(payment.amount)).ToString("0.00"); //应付价格传递给全局变量
                    Price_Recive = Price_Recive - double.Parse(payment.amount);
                    this.lbReceiveActual.Text = Price_Recive.ToString();
                    break;
                case "签单":
                    payment = PassValue.payments.Where(payments => payments.method.Equals("sign")).FirstOrDefault();
                    PassValue.payments.Remove(payment);
                    PassValue.Price_Now = (double.Parse(this.lbTotal.Text) + double.Parse(payment.amount)).ToString("0.00"); //应付价格传递给全局变量
                    Price_Recive = Price_Recive - double.Parse(payment.amount);
                    this.lbReceiveActual.Text = Price_Recive.ToString();
                    break;
                case "其他":
                    payment = PassValue.payments.Where(payments => payments.method.Equals("other")).FirstOrDefault();
                    PassValue.payments.Remove(payment);
                    PassValue.Price_Now = (double.Parse(this.lbTotal.Text) + double.Parse(payment.amount)).ToString("0.00"); //应付价格传递给全局变量
                    Price_Recive = Price_Recive - double.Parse(payment.amount);
                    this.lbReceiveActual.Text = Price_Recive.ToString();
                    break;
            }
            if (PassValue.discounts != null)
            {
                PassValue.Infor_payment.discounts = PassValue.discounts.ToArray();
                HttpResult httpResult = httpReq.HttpPatch(string.Format("consumptions/{0}", PassValue.consumptionid), PassValue.Infor_payment);
                if ((int)httpResult.StatusCode == 401)
                {
                    LoginBusiness lg = new LoginBusiness();
                    lg.LoginAgain();
                    return;
                }
                else if ((int)httpResult.StatusCode == 0)
                {
                    MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }
            }
            this.panelChildren.Controls.Clear();
            AddInformation();
        }
コード例 #43
0
        //消台操作
        private void Btn_Enter_Click(object sender, EventArgs e)
        {
            Desk d;
            d = (Desk)this.Owner;
            bool choose = false;
            ArrayList al = new ArrayList();
            foreach (Control ctl in this.panelTables.Controls)
            {
                if (ctl is DeskControl.DeskControl)
                {
                    DeskControl.DeskControl dcdc = (DeskControl.DeskControl)ctl;
                    if (dcdc.picCheck.Visible)
                    {
                        choose = true;
                        al.Add(dcdc.lbTableID.Text);
                    }
                }
            }
            if (!choose)
            {
                Messagebox mb = new Messagebox();
                PassValue.MessageInfor = "还未勾选桌子!";
                mb.ShowDialog();
                return;
            }

            foreach (string item in al)
            {
                d.CurrentChooseDesk.Remove(item);
            }

            Consumption cp = new Consumption();
            cp.id = this.Txt_Master.Text;
            int count = RestTableIDList.Count();
            cp.tables = new Table[count];
            for (int i = 0; i < count; i++)
            {
                cp.tables[i] = new Table();
                cp.tables[i].id = RestTableIDList[i];
            }
            cp.people = PeopleList[0];

            HttpResult httpResult;
            if (cp.tables.Count() == 0)
            {
                httpResult = httpReq.HttpDelete(string.Format("consumptions/{0}", PassValue.consumptionid));
            }
            else
            {
                httpResult = httpReq.HttpPatch(string.Format("consumptions/{0}", this.Txt_Master.Text), cp);
            }

            if ((int)httpResult.StatusCode == 409)
            {
                MessageBox.Show("选择的桌子已被操作,将为您刷新!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                AddTable();
                return;
            }
            else if ((int)httpResult.StatusCode == 401)
            {
                LoginBusiness lg = new LoginBusiness();
                lg.LoginAgain();
                return;
            }
            else if ((int)httpResult.StatusCode == 0)
            {
                MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }

            d.Refresh_Method();
            this.Close();
            PassValue.count_select_idle = 0;//被选中的桌子数量
            PassValue.count_select_ordering = cp.tables.Count();
            PassValue.selectedtableid.Clear();
            d.lbInfor.Text = d.lbInfor.Text.Split('[')[0] + "[空桌]";//餐台名称
            //人数
            d.lbPeople.Text = "0人";
        }
コード例 #44
0
ファイル: ListJoin.cs プロジェクト: zhuqinliang/Client
        //合并单子
        private void Btn_Enter_Click(object sender, EventArgs e)
        {
            if (SelectIDList != null)
            {
                if (SelectIDList.Count == 0)
                {
                    MessageBox.Show("您未选择任何桌子!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }

                Consumption personsConsumption = httpReq.HttpGet<Consumption>(string.Format("consumptions/{0}", this.Txt_Master.Text));

                if (personsConsumption.merge == null)
                {
                    Merge merge = new Merge();
                    List<Consumption> branches = new List<Consumption>();
                    Consumption master = new Consumption();
                    master.id = this.Txt_Master.Text;
                    for (int i = 0; i < SelectIDList.Count(); i++)
                    {
                        Consumption branch = new Consumption();
                        branch.id = SelectIDList[i];
                        branches.Add(branch);
                    }
                    merge.master = master;
                    merge.branches = branches.ToArray();
                    HttpResult httpResult = httpReq.HttpPost("consumptions/merge", merge);
                    if ((int)httpResult.StatusCode == 409)
                    {
                        MessageBox.Show("选择的桌子已被操作,请选择其他!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        AddTable();
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 401)
                    {
                        LoginBusiness lg = new LoginBusiness();
                        lg.LoginAgain();
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 0)
                    {
                        MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }
                }
                else if (personsConsumption.merge != null)
                {
                    Merge mg = new Merge();
                    List<Consumption> branches = new List<Consumption>();
                    Consumption merge = new Consumption();
                    merge.id = this.Txt_Master.Text;
                    Consumption master = new Consumption();
                    master.id = personsConsumption.merge.master.id;
                    for (int i = 0; i < SelectIDList.Count(); i++)
                    {
                        Consumption branch = new Consumption();
                        branch.id = SelectIDList[i];
                        branches.Add(branch);
                    }
                    for (int j = 0; j < personsConsumption.merge.branches.Count(); j++)
                    {
                        Consumption branch2 = new Consumption();
                        branch2.id = personsConsumption.merge.branches[j].id;
                        branches.Add(branch2);
                    }
                    mg.merge = merge;
                    mg.master = master;
                    mg.branches = branches.ToArray();

                    HttpResult httpResult = httpReq.HttpPost("consumptions/merge", mg);
                    if ((int)httpResult.StatusCode == 409)
                    {
                        MessageBox.Show("选择的桌子已被操作,请选择其他!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        AddTable();
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 401)
                    {
                        LoginBusiness lg = new LoginBusiness();
                        lg.LoginAgain();
                        return;
                    }
                    else if ((int)httpResult.StatusCode == 0)
                    {
                        MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }
                }
                MessageBox.Show("合并成功!");
                Desk d;
                d = (Desk)this.Owner;
                d.Refresh_Method();
                this.Close();
            }
        }
コード例 #45
0
ファイル: ChangeTable.cs プロジェクト: zhuqinliang/Client
        //提交
        private void Btn_Enter_Click(object sender, EventArgs e)
        {
            if (SelectIDList.Count > 0)
            {
                Desk d;
                d = (Desk)this.Owner;

                d.CurrentChooseDesk.Clear();
                //添加桌子
                foreach (Control ctl in this.panelTables.Controls)
                {
                    if (ctl is DeskControl.DeskControl)
                    {
                        DeskControl.DeskControl dc = (DeskControl.DeskControl)ctl;
                        if (dc.picCheck.Visible)
                        {
                            d.CurrentChooseDesk.Add(dc.lbTableID.Text, string.Format("{0}({1})", dc.lbName.Text, dc.lbNumber.Text));
                        }
                    }
                }

                Consumption cp = new Consumption();
                cp.id = this.Txt_ID.Text;
                cp.tables = new Table[SelectIDList.Count()];
                cp.people = people;
                int i = 0;
                foreach (string id in SelectIDList)
                {
                    Table table = new Table();
                    table.id = id;
                    cp.tables[i++] = table;
                }

                HttpResult httpResult = httpReq.HttpPatch(string.Format("consumptions/{0}", cp.id), cp);
                if ((int)httpResult.StatusCode == 409)
                {
                    MessageBox.Show("选择的桌子已被操作,请选择其他!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    AddTable();
                    return;
                }
                else if ((int)httpResult.StatusCode == 401)
                {
                    LoginBusiness lg = new LoginBusiness();
                    lg.LoginAgain();
                    return;
                }
                else if ((int)httpResult.StatusCode == 0)
                {
                    MessageBox.Show(string.Format("{0}{1}", httpResult.StatusDescription, httpResult.OtherDescription), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }

                MessageBox.Show("换台成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                d.Refresh_Method();
                this.Close();
            }
            else
            {
                MessageBox.Show("请先选择桌子!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }