Пример #1
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(this.textName.Text) || modeList.Count <= 0)
     {
         XtraMessageBox.Show("请填写完整信息!");
     }
     if (vo != null)
     {
         if (DeleteDao.DelPermissionByName(vo.Name) < 1)
         {
             XtraMessageBox.Show("操作失败!");
             return;
         }
     }
     foreach (string name in modeList)
     {
         PermissionVo vo = new PermissionVo()
         {
             Name = this.textName.Text, ModeName = name, CompanyId = SystemConst.companyId
         };
         InsertDao.InsertData(vo, typeof(PermissionVo));
     }
     XtraMessageBox.Show("保存权限组成功!");
     this.DialogResult = DialogResult.OK;
 }
Пример #2
0
        protected override void BtnSave_Click(object sender, EventArgs e)
        {
            List <StaffClassVo> staffOldInfoList = SelectDao.SelectData <StaffClassVo>();
            List <StaffClassVo> changeList       = GenericUtil.GetChanges(classList, staffOldInfoList);
            int result = 0;

            if (!CheckParam(changeList))
            {
                return;
            }
            foreach (StaffClassVo vo in changeList)
            {
                if (SelectDao.IsRepeatedClassId(vo.StaffClassID))
                {
                    //更新
                    result = UpdateDao.UpdateByID(vo);
                    if (result <= 0)
                    {
                        XtraMessageBox.Show(vo.StaffClassID + "更新失败!");
                        break;
                    }
                }
                else
                {
                    vo.CompanyId = SystemConst.companyId;
                    result       = InsertDao.InsertData(vo);
                    if (result <= 0)
                    {
                        XtraMessageBox.Show(vo.StaffClassID + "保存失败!");
                        break;
                    }
                }
            }
            XtraMessageBox.Show("保存成功!");
        }
Пример #3
0
        private void BtnAddPrice_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.textPriceA.Text) || string.IsNullOrWhiteSpace(this.textPriceB.Text) || string.IsNullOrWhiteSpace(this.textPriceC.Text))
            {
                XtraMessageBox.Show("价格信息不完整!");
                return;
            }
            if (!FilterUtil.isNumberic(this.textPriceA.Text) || !FilterUtil.isNumberic(this.textPriceB.Text) || !FilterUtil.isNumberic(this.textPriceC.Text))
            {
                XtraMessageBox.Show("价格信息不正确!");
                return;
            }
            SkillPriceVo vo = new SkillPriceVo()
            {
                SkillName = this.textServerNP.Text,
                PriceType = this.comboType.Text,
                PriceA    = Convert.ToDouble(this.textPriceA.Text),
                PriceB    = Convert.ToDouble(this.textPriceB.Text),
                PriceC    = Convert.ToDouble(this.textPriceC.Text),
                Remark    = this.textreamark.Text,
                CompanyId = SystemConst.companyId
            };

            if (SelectDao.IsExistSkillPrice(vo.SkillName, vo.PriceType))
            {
                XtraMessageBox.Show("此价格已经存在!");
                return;
            }
            if (InsertDao.InsertData(vo, typeof(SkillPriceVo)) > 0)
            {
                XtraMessageBox.Show("添加价格成功!");
                RefreshSkillPrice(this.textServerNP.Text);
            }
        }
Пример #4
0
        private void BtnAddSever_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.textServerName.Text))
            {
                XtraMessageBox.Show("请填写服务名!");
                return;
            }
            if (string.IsNullOrWhiteSpace(this.textSecond.Text))
            {
                XtraMessageBox.Show("请填写服务别名!");
                return;
            }
            if (string.IsNullOrWhiteSpace(this.comboTime.Text))
            {
                XtraMessageBox.Show("请填写服务时长!");
                return;
            }
            if (SelectDao.IsServerNameExist(this.textServerName.Text))
            {
                XtraMessageBox.Show("该服务名已经存在!");
                return;
            }
            SkillVo vo = new SkillVo();

            vo.SkillName  = this.textServerName.Text;
            vo.SecondName = this.textSecond.Text;
            vo.ServerTime = this.comboTime.Text;
            vo.Remark     = this.memoSerRemark.Text;
            vo.CompanyId  = SystemConst.companyId;
            if (InsertDao.InsertData(vo, typeof(SkillVo)) > 0)
            {
                XtraMessageBox.Show("添加项目成功!");
                RefreshSkill();
            }
        }
Пример #5
0
        private void BtnAddT_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.textPriceA.Text) || string.IsNullOrWhiteSpace(this.textPriceB.Text) || string.IsNullOrWhiteSpace(this.textPriceC.Text))
            {
                XtraMessageBox.Show("价格信息不完整!");
                return;
            }
            if (!FilterUtil.isNumberic(this.textPriceA.Text) || !FilterUtil.isNumberic(this.textPriceB.Text) || !FilterUtil.isNumberic(this.textPriceC.Text))
            {
                XtraMessageBox.Show("价格信息不正确!");
                return;
            }
            SkillCommisionVo vo = new SkillCommisionVo()
            {
                SkillName  = this.textSkillName.Text,
                StaffLevel = this.comboLevel.Text,
                PriceA     = Convert.ToDouble(this.textPriceAT.Text),
                PriceB     = Convert.ToDouble(this.textPriceBT.Text),
                PriceC     = Convert.ToDouble(this.textPriceCT.Text),
                Remark     = this.textreamark.Text,
                CompanyId  = SystemConst.companyId
            };

            if (InsertDao.InsertData(vo, typeof(SkillCommisionVo)) > 0)
            {
                XtraMessageBox.Show("添加技师提成成功!");
                RefreshSkillCommision(this.textSkillName.Text);
            }
        }
Пример #6
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.textRoomId.Text) || string.IsNullOrWhiteSpace(this.textRoomName.Text))
            {
                XtraMessageBox.Show("请填写完整信息!");
                return;
            }
            if (CheckRoomId())
            {
                XtraMessageBox.Show("房间编号必须为数字或者房间编号已存在!");
                return;
            }
            RoomVo vo = new RoomVo()
            {
                RoomId     = Convert.ToInt32(this.textRoomId.Text),
                RoomName   = this.textRoomName.Text,
                RoomStatus = this.comboStatus.Text,
                CompanyId  = SystemConst.companyId
            };

            if (InsertDao.InsertData(vo, typeof(RoomVo)) > 0)
            {
                XtraMessageBox.Show("添加房间成功!");
                EventBus.PublishEvent("AddRoomSuccessed", this, vo);
            }
            this.DialogResult = DialogResult.OK;
        }
Пример #7
0
 private void SaveStaffQueue(List <StaffQueueVo> newqueueList)
 {
     //先删除之前的
     DeleteDao.DeleteStaffQueue();
     foreach (StaffQueueVo vo in newqueueList)
     {
         InsertDao.InsertData(vo, typeof(StaffQueueVo));
     }
 }
Пример #8
0
 private void BtnAdd_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(this.textName.Text) || skillVoList.Count <= 0)
     {
         XtraMessageBox.Show("请将信息填写完整!");
         return;
     }
     foreach (SkillVo skill in skillVoList)
     {
         ServerVo vo = new ServerVo()
         {
             ServerName = this.textName.Text, SkillId = skill.SkillId, SkillName = skill.SkillName, CompanyId = SystemConst.companyId
         };
         InsertDao.InsertData(vo, typeof(ServerVo));
     }
     XtraMessageBox.Show("添加项目成功!");
     EventBus.PublishEvent("AddServerSuccessed");
 }
Пример #9
0
 private void BtnAdd_Click(object sender, EventArgs e)
 {
     if (!CheckParam())
     {
         XtraMessageBox.Show("信息不完整请检查", "提示");
         return;
     }
     if (memberVo == null)
     {
         //添加会员
         List <object> infoList = new List <object>()
         {
             this.textMId.Text, this.textMName.Text, this.comCardLevel.Text, this.textPhone.Text, this.comStatus.Text, Convert.ToDouble(this.textBalance.Text), SystemConst.companyId
         };
         if (ProcedureDao.MemberRegister(infoList) > 0)
         {
             XtraMessageBox.Show("添加会员成功!", "提示");
             EventBus.PublishEvent("AddMemberSuccess");
             EventBus.PublishEvent("MemberRechargeSuccess");
         }
         else
         {
             XtraMessageBox.Show("添加会员失败!", "提示");
             return;
         }
     }
     else
     {
         memberVo.MName     = this.textMName.Text;
         memberVo.MPhone    = this.textPhone.Text;
         memberVo.CardName  = this.comCardLevel.Text;
         memberVo.CompanyId = SystemConst.companyId;
         if (InsertDao.InsertData(memberVo, typeof(MemberInfoVo)) > 0)
         {
             XtraMessageBox.Show("更新会员成功!", "提示");
         }
         else
         {
             XtraMessageBox.Show("更新会员失败!", "提示");
         }
     }
     this.DialogResult = DialogResult.OK;
 }
Пример #10
0
        private void BtnQuery_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.textEdit1.Text))
            {
                XtraMessageBox.Show("公司名称不能为空!");
                return;
            }
            CompanyVo vo = new CompanyVo()
            {
                Name    = this.textEdit1.Text,
                Address = this.textEdit2.Text,
                Manager = this.textEdit3.Text
            };
            object id;

            if ((id = InsertDao.InsertDataRetrunID(vo)) != null)
            {
                config.AppSettings.Settings["CompanyId"].Value = id.ToString();
                XtraMessageBox.Show("操作成功!");
            }
        }
Пример #11
0
 private void BtnAdd_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(this.textUserName.Text) || string.IsNullOrWhiteSpace(this.comMode.Text) || string.IsNullOrWhiteSpace(this.textPassword.Text))
     {
         XtraMessageBox.Show("请填写完整信息!");
     }
     else
     {
         //更新
         if (userVo != null)
         {
             userVo.Name   = this.textUserName.Text;
             userVo.Role   = this.comMode.Text;
             userVo.Psword = this.textPassword.Text;
             UpdateDao.UpdateByID(userVo);
             XtraMessageBox.Show("保存成功!");
             this.DialogResult = DialogResult.OK;
             return;
         }
         //新增
         UserRoleVo vo = new UserRoleVo()
         {
             Name      = this.textUserName.Text,
             Role      = this.comMode.Text,
             Psword    = this.textPassword.Text,
             CompanyId = SystemConst.companyId
         };
         if (SelectDao.IsUserExist(vo.Name))
         {
             XtraMessageBox.Show("该用户已经存在!");
             return;
         }
         if (InsertDao.InsertData(vo, typeof(UserRoleVo)) > 0)
         {
             XtraMessageBox.Show("保存成功!");
             this.DialogResult = DialogResult.OK;
             return;
         }
     }
 }
Пример #12
0
        private void BtnQuery_Click(object sender, EventArgs e)
        {
            OrderInfoVo vo = new OrderInfoVo();

            vo.OrderID    = GenrateIDUtil.GenerateOrderID();
            vo.Price      = Convert.ToDouble(this.textPrice.Text);
            vo.Tax        = Convert.ToDouble(this.textGst.Text);
            vo.TotalPrice = Convert.ToDouble(this.textTotal.Text);
            vo.PriceType  = this.comboType.Text;
            vo.EndTime    = DateTime.Now;
            vo.CompanyId  = SystemConst.companyId;
            if (TransactionDao.DealOrder(vo, selectedVoList, this.comboType.Text))
            {
                //删除临时订单
                foreach (TempOrderVo tempVo in selectedVoList)
                {
                    DeleteDao.DeleteByID(tempVo.Id, typeof(TempOrderVo));
                }
                //会员消费记录
                if (!string.IsNullOrWhiteSpace(this.textMemberId.Text))
                {
                    MemberConsumeVo consumeVo = new MemberConsumeVo();
                    string          consumeId = GenrateIDUtil.GenerateConsumeID();
                    consumeVo.Id          = consumeId;
                    consumeVo.MId         = this.textMemberId.Text;
                    consumeVo.MName       = SelectDao.GetMemberNameByID(this.textMemberId.Text);
                    consumeVo.Amount      = double.Parse(this.textTotal.Text);
                    consumeVo.ConsumeTime = DateTime.Now;
                    consumeVo.CompanyId   = SystemConst.companyId;
                    InsertDao.InsertData(consumeVo);
                }
                XtraMessageBox.Show("买单成功!");
                EventBus.PublishEvent("StaffWorkStatusChange");
            }
            else
            {
                XtraMessageBox.Show("买单失败!");
            }
        }
Пример #13
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     using (TranMng TM = new TranMng())
     {
         //現在保存しているセッションを削除
         InsertDao ID = new InsertDao();
         Session.Remove("msg");
         string error = "";
         try
         {
             //入力された情報をインサート文に渡す。
             //エラーにはエラーメッセージが返ってくる
             string BirthDay = BirthYearList.Text + "/" + BirthMonthList.Text + "/" + BirthDayList.Text;
             string Join     = JoinYearList.Text + "/" + JoinMonthList.Text + "/" + JoinDayList.Text;
             error = ID.Insert(TextBox1.Text, TextBox2.Text, TextBox4.Text, TextBox3.Text, TextBox5.Text, int.Parse(DropDownList1.Text), BirthDay, DropDownList2.Text, Join);
         }
         catch (FormatException)
         {
             error = "未入力項目があります。";
         }
         Session.Add("msg", error);
         Server.Transfer("Result.aspx");
     }
 }
Пример #14
0
        protected override void BtnSave_Click(object sender, EventArgs e)
        {
            List <DepartmentVo> staffOldInfoList = SelectDao.SelectData <DepartmentVo>();
            List <DepartmentVo> changeList       = GenericUtil.GetChanges(departmentVoList, staffOldInfoList);
            int result = 0;

            if (!CheckParam(changeList))
            {
                return;
            }
            foreach (DepartmentVo vo in changeList)
            {
                if (SelectDao.IsRepeatedDepartmentId(vo.Id))
                {
                    //更新
                    result = UpdateDao.UpdateByID(vo);
                    if (result <= 0)
                    {
                        XtraMessageBox.Show(vo.Id + "更新失败!");
                        break;
                    }
                }
                else
                {
                    vo.CompanyId = SystemConst.companyId;
                    result       = InsertDao.InsertData(vo);
                    if (result <= 0)
                    {
                        XtraMessageBox.Show(vo.Id + "保存失败!");
                        break;
                    }
                }
            }
            EventBus.PublishEvent("UpdateDepartment");
            XtraMessageBox.Show("保存成功!");
        }