Example #1
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("确定要删除吗?", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    dosage.Id = Guid.Parse(selectId);

                    string msg = string.Empty;
                    PharmacyDatabaseService.DeleteDictionaryDosage(out msg, dosage.Id);

                    if (string.IsNullOrEmpty(msg))
                    {
                        //删除成功
                        this.FormState = FormOperation.Empty;
                        //refresh datview
                        RefreshDataView();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("删除数据失败!", "错误");
                Log.Error(ex);
            }
        }
Example #2
0
 public FormDepartmentEdit(FormOperation formOperation, FormDepartment from)
 {
     InitializeComponent();
     this._deptform = from;
     _Operation     = formOperation;
     this.Text      = "部门新增";
 }
Example #3
0
 public FormModuleEdit(FormOperation formOperation, Module module)
 {
     InitializeComponent();
     _Operation = formOperation;
     _Module    = module;
     this.Text  = "功能模块修改";
 }
Example #4
0
        }//窗口随意拖动

        #endregion

        #region 加载事件
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            #region 右上方三个按钮
            //右上方三个按钮
            FormOperation operation = new FormOperation(this, true);
            operation.VerticalAlignment   = VerticalAlignment.Top;
            operation.HorizontalAlignment = HorizontalAlignment.Right;
            this.body.Children.Add(operation);//添加控件
            #endregion


            media_Detial.Source = localUri;                   //设置Source
            media_Detial.Margin = new Thickness(0, 20, 0, 0); //设置顶部边距20

            #region 如果为视频类型 ,就添加播放按钮
            //如果为媒体类型 ,就添加播放按钮
            if (Type == mediaType.video)
            {
                //如果是视频类型 ,就手动播放音频
                media_Detial.LoadedBehavior = MediaState.Manual;
            }
            else if (Type == mediaType.image)
            {
                //隐藏播放按钮
                controlBtn.Visibility       = Visibility.Hidden;
                media_Detial.LoadedBehavior = MediaState.Play;
            }
            #endregion

            //设置宽度
            bd_out.Width = media_Detial.Width;
            body.Width   = media_Detial.Width;
            Width        = media_Detial.Width;
        }
Example #5
0
 public FormUserEdit(FormOperation formOperation, User user)
 {
     InitializeComponent();
     _Operation = formOperation;
     _user      = user;
     this.Text  = "用户修改";
 }
Example #6
0
        private void SaveData()
        {
            try
            {
                unit.Name = txtName.Text.Trim();

                string msg = string.Empty;
                if (string.IsNullOrEmpty(selectId))
                {
                    unit.Id = Guid.NewGuid();
                    PharmacyDatabaseService.AddDictionarySpecification(out msg, unit);
                }
                else
                {
                    unit.Id = Guid.Parse(selectId);
                    PharmacyDatabaseService.SaveDictionarySpecification(out msg, unit);
                }
                if (string.IsNullOrEmpty(msg))
                {
                    this.FormState = FormOperation.Empty;

                    RefreshDataView();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存数据失败!", "错误");
                Log.Error(ex);
            }
        }
Example #7
0
        private void OnAfterStateChanged(FormOperation state)
        {
            switch (state)
            {
                #region case state of empty
            case FormOperation.Empty:
                this.txtName.Text      = "";
                this.checkBox1.Checked = false;

                this.selectId  = string.Empty;
                this.selectRow = -1;


                break;
                #endregion

                #region case state of edit 双击数据行,可删除或修改
            case FormOperation.Modify:

                break;
                #endregion

            default:
                break;
            }
        }
Example #8
0
 public FormModuleCategoryEdit(FormOperation formOperation, ModuleCatetory moduleCategory)
 {
     InitializeComponent();
     _Operation      = formOperation;
     _moduleCategory = moduleCategory;
     this.Text       = "功能模块大类修改";
 }
Example #9
0
        /// <summary>
        /// 判断该线条是否通过
        /// </summary>
        /// <param name="formData"></param>
        /// <param name="conditionJson"></param>
        /// <returns></returns>
        private bool IsLineOK(string formData, List <WFLineConditionModel> conditionJson)
        {
            bool res = false;
            //dynamic formDataJson = formData.ToJObject();//获取数据内容

            FormOperation formOperation = new FormOperation();

            foreach (var item in conditionJson)//轮询该线条上的所有条件
            {
                string fieldId   = item.FieldId.Split('|')[1];
                string formvalue = formOperation.GetValue(formData, fieldId); //   formDataJson[fieldId].ToString();
                if (!string.IsNullOrEmpty(formvalue))
                {
                    bool compareValue = LineCompared(formvalue, item.FilterId, item.FilterValue);
                    if (item.Logic == "AND")
                    {
                        res = compareValue;
                        if (!compareValue)
                        {
                            break;
                        }
                    }
                    else
                    {
                        if (compareValue)
                        {
                            res = compareValue;
                        }
                    }
                }
            }
            return(res);
        }
Example #10
0
 public FormRoleEdit(FormOperation formOperation, Role role)
 {
     InitializeComponent();
     _Operation = formOperation;
     _role      = role;
     this.Text  = "角色修改";
 }
Example #11
0
 public FormModuleCategoryEdit(FormOperation formOperation)
 {
     InitializeComponent();
     _Operation      = formOperation;
     _moduleCategory = new ModuleCatetory();
     this.Text       = "功能模块大类新增";
 }
Example #12
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex == -1)
                {
                    return;
                }

                this.FormState = FormOperation.Modify;
                this.selectRow = e.RowIndex;

                if ((bool)dataGridView1.Rows[e.RowIndex].Cells["Enabled"].Value == true)
                {
                    this.checkBox1.Checked = true;
                }
                else
                {
                    this.checkBox1.Checked = false;
                }
                this.selectId     = dataGridView1.Rows[e.RowIndex].Cells["Id"].Value.ToString();
                this.txtName.Text = dataGridView1.Rows[e.RowIndex].Cells["Name"].Value.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show("操作失败!", "错误");
                Log.Error(ex);
            }
        }
Example #13
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(selectId))
                {
                    MessageBox.Show("未选择要删除的数据!");
                    return;
                }

                if (MessageBox.Show("确定要删除吗?", "信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                {
                    //删除数据
                    unit.Id = Guid.Parse(selectId);

                    string msg = string.Empty;
                    //PharmacyDatabaseService.SaveDictionarySpecification(out msg, unit);
                    PharmacyDatabaseService.DeleteDictionarySpecification(out msg, unit.Id);
                    if (string.IsNullOrEmpty(msg))
                    {
                        //删除成功
                        this.FormState = FormOperation.Empty;
                        //refresh datview
                        RefreshDataView();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("删除数据失败!", "错误");
                Log.Error(ex);
            }
        }
        public FormDictionaryUserDefinedType()
        {
            InitializeComponent();

            unit               = new DictionaryUserDefinedType();
            _formSate          = FormOperation.Empty;
            selectId           = string.Empty;
            selectRow          = -1;
            afterStateChanged += new AfterStateChanged(OnAfterStateChanged);
        }
Example #15
0
 /// <summary>
 /// 初始化窗体UI
 /// </summary>
 private void InitialUI()
 {
     #region 初始化三个按钮
     FormOperation operation = new FormOperation(this, false);
     operation.HorizontalAlignment = HorizontalAlignment.Right;
     operation.VerticalAlignment   = VerticalAlignment.Top;
     Grid.SetColumn(operation, 1);//
     //gd_Children.Add(operation);
     #endregion
 }
Example #16
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     #region 添加右上角按钮
     FormOperation operation = new FormOperation(this, false);
     operation.VerticalAlignment   = VerticalAlignment.Top;
     operation.HorizontalAlignment = HorizontalAlignment.Right;
     Grid.SetColumnSpan(operation, 3);
     gd_main.Children.Add(operation);
     #endregion
 }
Example #17
0
        public FormDrugCategory()
        {
            InitializeComponent();

            unit               = new DrugCategory();
            _formSate          = FormOperation.Empty;
            selectId           = string.Empty;
            selectRow          = -1;
            afterStateChanged += new AfterStateChanged(OnAfterStateChanged);
        }
Example #18
0
        public FormVehicleEdit(Vehicle vehicle, bool r = false)
        {
            InitializeComponent();

            ListVehicle = this.PharmacyDatabaseService.AllVehicles(out msg).ToList();

            if (vehicle == null)
            {
                this.Width   = 280;
                this.Text    = "新增车辆";
                m_state      = FormOperation.Add;
                m_Vehicle.Id = Guid.NewGuid();
                this.id      = Guid.NewGuid();
                this.comboBox1.SelectedIndex = 0;
            }
            else
            {
                this.Width = 280;
                this.Text  = "修改车辆";
                m_state    = FormOperation.Modify;
                m_Vehicle  = vehicle;
                this.id    = vehicle.Id;

                this.txtType.Text            = vehicle.Type;
                this.txtCubage.Text          = vehicle.Cubage;
                this.txtDriver.Text          = vehicle.Driver;
                this.txtRule.Text            = vehicle.Rule;
                this.txtLicensePlate.Text    = vehicle.LicensePlate;
                this.txtOther.Text           = vehicle.Other;
                this.chkStatus.Checked       = vehicle.Status;
                this.comboBox1.SelectedIndex = vehicle.VehicleCategoryValue;
                if (this.comboBox1.SelectedIndex == 1)
                {
                    this.Width = 540;
                    this.txtDelegateMan.Text     = vehicle.DelegateMan;
                    this.txtDelegateCompany.Text = vehicle.DelegateCompany;
                    this.txtDelegateTel.Text     = vehicle.DelegateTel;
                    this.textBox2.Text           = vehicle.LiscenceCode;
                    this.textBox1.Text           = vehicle.DelegateAddr;
                    this.textBox3.Text           = vehicle.DelegateScope;
                    this.dateTimePicker1.Value   = vehicle.StartDate == null?DateTime.Now.Date:(DateTime)vehicle.StartDate;
                    this.dateTimePicker2.Value   = vehicle.EndDate == null?DateTime.Now.Date:(DateTime)vehicle.EndDate;
                }
            }
            if (r)
            {
                foreach (Control c in this.Controls)
                {
                    c.Enabled = false;
                }
                btnSave.Visible   = false;
                btnCancel.Visible = false;
            }
        }
Example #19
0
 public SettingsWindow()
 {
     InitializeComponent();
     Snackbar = new SnackbarMessageQueue();
     #region 添加右上角按钮
     FormOperation operation = new FormOperation(this, false);
     this.body.Children.Add(operation);
     operation.VerticalAlignment   = VerticalAlignment.Top;
     operation.HorizontalAlignment = HorizontalAlignment.Right;
     #endregion
 }
 private void FormDictionaryUserDefinedType_Load(object sender, EventArgs e)
 {
     try
     {
         this.FormState = FormOperation.Empty;
         RefreshDataView();
     }
     catch (Exception ex)
     {
         MessageBox.Show("窗口启动失败!", "错误");
         Log.Error(ex);
     }
 }
Example #21
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     #region 添加最大化、最小化、关闭按钮
     //设置标题栏的按钮
     FormOperation operation = new FormOperation(this, false);
     //设置对齐  向左  向上
     operation.VerticalAlignment   = VerticalAlignment.Top;
     operation.HorizontalAlignment = HorizontalAlignment.Right;
     //添加到窗口中
     Grid.SetColumn(operation, 2);
     Grid.SetRow(operation, 0);
     this.gd_Content.Children.Add(operation);
     #endregion
 }
Example #22
0
 public GroupShare(string roomId)
 {
     InitializeComponent();
     #region 添加右上角按钮
     this._roomId = roomId;
     FormOperation operation = new FormOperation(this, false);
     operation.VerticalAlignment   = VerticalAlignment.Top;
     operation.HorizontalAlignment = HorizontalAlignment.Right;
     Panel.SetZIndex(operation, 4);
     //添加到窗口中
     this.gd_main.Children.Add(operation);
     #endregion
     DataContext = new GroupShareViewModel(roomId);
 }
Example #23
0
        public LoginSettingsWindow()
        {
            InitializeComponent();
            Snackbar = new SnackbarMessageQueue();
            this.tb_InitialServer.Text      = ConfigurationUtil.GetValue("InitialServer");
            this.tb_InitialServerOfKey.Text = ConfigurationUtil.GetValue("InitialServer_key");

            #region 添加右上角按钮
            FormOperation operation = new FormOperation(this, false);
            this.body.Children.Add(operation);
            operation.VerticalAlignment   = VerticalAlignment.Top;
            operation.HorizontalAlignment = HorizontalAlignment.Right;
            #endregion
        }
        public override IEnumerable <AbsSynchroDataInfo> GetK3Datas(Context ctx, FormOperation oper = null)
        {
            List <K3CustomerInfo> custs = null;
            K3CustomerInfo        cust  = null;

            if (SelectedNos != null && SelectedNos.Count() > 0)
            {
                string sql = string.Format(@"/*dialect*/ select b.FNUMBER as FUseOrgId,a.FNUMBER,a.F_HS_FixedFreightDiscount,a.F_HS_IntegralReturnRate ,a.F_HS_OnlineDiscount,a.F_HS_TTDiscount
                                                ,a.F_HS_DiscountChangeRemark,a.F_HS_OldOnlineDiscount,a.F_HS_OldTTDISCOUNT,a.F_HS_OldFixedFreightDiscount
                                                ,a.F_HS_OldIntegralReturnRate
                                                from T_BD_CUSTOMER a
                                                inner join T_ORG_ORGANIZATIONS b on a.FUSEORGID = b.FORGID
                                                where a.FNUMBER in ('{0}')
                                                and b.FNUMBER = '{1}'", string.Join("','", SelectedNos), "100.01");

                DynamicObjectCollection coll = SQLUtils.GetObjects(ctx, sql);

                if (coll != null && coll.Count > 0)
                {
                    custs = new List <K3CustomerInfo>();

                    foreach (var item in coll)
                    {
                        if (item != null)
                        {
                            cust = new K3CustomerInfo();

                            cust.FUseOrgId = SQLUtils.GetFieldValue(item, "FUseOrgId");
                            cust.FNumber   = SQLUtils.GetFieldValue(item, "FNUMBER");
                            cust.SrcNo     = cust.FNumber;
                            cust.F_HS_FixedFreightDiscount = Convert.ToDecimal(SQLUtils.GetFieldValue(item, "F_HS_FixedFreightDiscount"));
                            cust.F_HS_IntegralReturnRate   = Convert.ToDecimal(SQLUtils.GetFieldValue(item, "F_HS_IntegralReturnRate"));
                            cust.F_HS_OnlineDiscount       = Convert.ToDecimal(SQLUtils.GetFieldValue(item, "F_HS_OnlineDiscount"));
                            cust.F_HS_TTDiscount           = Convert.ToDecimal(SQLUtils.GetFieldValue(item, "F_HS_TTDiscount"));
                            cust.F_HS_DiscountChangeRemark = SQLUtils.GetFieldValue(item, "F_HS_DiscountChangeRemark");

                            cust.F_HS_OldOnlineDiscount = Convert.ToDecimal(SQLUtils.GetFieldValue(item, "F_HS_OldOnlineDiscount"));
                            cust.F_HS_OldTTDISCOUNT     = Convert.ToDecimal(SQLUtils.GetFieldValue(item, "F_HS_OldTTDISCOUNT"));

                            cust.F_HS_OldFixedFreightDiscount = Convert.ToDecimal(SQLUtils.GetFieldValue(item, "F_HS_OldFixedFreightDiscount"));
                            cust.F_HS_OldIntegralReturnRate   = Convert.ToDecimal(SQLUtils.GetFieldValue(item, "F_HS_OldIntegralReturnRate"));

                            custs.Add(cust);
                        }
                    }
                }
            }

            return(custs);
        }
Example #25
0
        private void FormDictionaryDosage_Load(object sender, EventArgs e)
        {
            try
            {
                this.FormState = FormOperation.Empty;

                //to load datagridview
                RefreshDataView();
            }
            catch (Exception ex)
            {
                MessageBox.Show("窗口启动失败!", "错误");
                Log.Error(ex);
            }
        }
Example #26
0
        /// <summary>
        /// Initial a UserDetail Window
        /// </summary>
        private UserDetailView()
        {
            InitializeComponent();
            //注册关闭窗口
            Messenger.Default.Register <bool>(this, CloseWindow, value => { this.Close(); });

            #region 添加右上角按钮
            FormOperation operation = new FormOperation(this, false);
            Grid.SetColumnSpan(operation, 3);
            operation.VerticalAlignment   = VerticalAlignment.Top;
            operation.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
            //添加到窗口中
            this.body.Children.Add(operation);
            #endregion
        }
Example #27
0
        public RoomVerifyForm(Messageobject msg)
        {
            InitializeComponent();
            var rverifymodel = new RoomVerifyViewModel();

            rverifymodel.Initial(msg);
            this.DataContext = rverifymodel;
            App.Current.Dispatcher.Invoke(() =>
            {
                //UserId = userId;
                #region 添加右上角按钮
                FormOperation operation = new FormOperation(this, false);
                Grid.SetColumnSpan(operation, 3);//
                operation.VerticalAlignment   = VerticalAlignment.Top;
                operation.HorizontalAlignment = HorizontalAlignment.Right;
                //添加到窗口中
                this.gd_main.Children.Add(operation);
                #endregion
            });
        }
Example #28
0
        private void SaveData()
        {
            try
            {
                DrugType unit = new DrugType();

                unit.Name       = txtName.Text.Trim();
                unit.Code       = txtCode.Text.Trim();
                unit.Decription = txtDescription.Text.Trim();
                unit.Enabled    = checkBox1.Checked;
                if (this.cbxCategory.DataSource != null)
                {
                    unit.DrugCategoryId = Guid.Parse(this.cbxCategory.SelectedValue.ToString());
                }


                string msg = string.Empty;
                if (string.IsNullOrEmpty(selectId))
                {
                    unit.Id = Guid.NewGuid();
                    PharmacyDatabaseService.AddDrugType(out msg, unit);
                }
                else
                {
                    unit.Id = Guid.Parse(selectId);
                    PharmacyDatabaseService.SaveDrugType(out msg, unit);
                }
                if (string.IsNullOrEmpty(msg))
                {
                    this.FormState = FormOperation.Empty;

                    RefreshDataView();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存数据失败!", "错误");
                Log.Error(ex);
            }
        }
Example #29
0
        /// <summary>
        /// 判断该线条是否通过
        /// </summary>
        /// <param name="formDataList"></param>
        /// <param name="conditionJson"></param>
        /// <returns></returns>
        private bool IsLineOK(List <WFVerificationFormModel> formDataList, List <WFLineConditionModel> conditionJson)
        {
            bool          res = false;
            string        formId = "", formData = "[]";
            FormOperation formOperation = new FormOperation();

            foreach (var item in conditionJson)//轮询该线条上的所有条件
            {
                string fieldId = item.FieldId.Split('|')[1];
                string formId1 = item.FieldId.Split('|')[0];
                if (formId1 != formId)
                {
                    formId   = formId1;
                    formData = GetFormData(formId, formDataList);
                }
                string formvalue = formOperation.GetValue(formData, fieldId);
                if (!string.IsNullOrEmpty(formvalue))
                {
                    bool compareValue = LineCompared(formvalue, item.FilterId, item.FilterValue);
                    if (item.Logic == "AND")
                    {
                        res = compareValue;
                        if (!compareValue)
                        {
                            break;
                        }
                    }
                    else
                    {
                        if (compareValue)
                        {
                            res = compareValue;
                        }
                    }
                }
            }
            return(res);
        }
        private void SaveData()
        {
            try
            {
                unit.Name       = txtName.Text.Trim();
                unit.Code       = txtCode.Text.Trim();
                unit.Decription = txtDescription.Text.Trim();

                unit.Enabled = checkBox1.Checked;

                string msg = string.Empty;
                if (string.IsNullOrEmpty(selectId))
                {
                    unit.Id = Guid.NewGuid();
                    PharmacyDatabaseService.AddDictionaryUserDefinedType(out msg, unit);
                }
                else
                {
                    unit.Id = Guid.Parse(selectId);
                    PharmacyDatabaseService.SaveDictionaryUserDefinedType(out msg, unit);
                }
                if (string.IsNullOrEmpty(msg))
                {
                    this.FormState = FormOperation.Empty;

                    RefreshDataView();
                }
                else
                {
                    MessageBox.Show(msg, "Error");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存数据失败!", "错误");
                Log.Error(ex);
            }
        }