示例#1
0
        private void Save_button_Click(object sender, EventArgs e)
        {
            if (deptid_selTextInpt.Text == "" || deptid_selTextInpt.Value == "")
            {
                WJs.alert("请选择一个科室");
                deptid_selTextInpt.Focus();
                return;
            }
            if (ytComboBox1.SelectedIndex < 0)
            {
                WJs.alert("请选择一个状态!");
                ytComboBox1.Focus();
                return;
            }
            if (useman_textBox.Text.Trim() == "")
            {
                WJs.alert("请填写使用人!");
                useman_textBox.Focus();
                return;
            }
            if (usenum_textBox.Text.Trim() == "")
            {
                WJs.alert("请填写使用次数!");
                usenum_textBox.Focus();
                return;
            }

            if (!WJs.IsD0Zs(usenum_textBox.Text) || Convert.ToInt32(usenum_textBox.Text) < 0)
            {
                WJs.alert("使用次数:请输入一个正整数!");
                usenum_textBox.Focus();
                return;
            }
            if (CLfare_textBox.Text.Trim() != "" && CLfare_textBox.Text.Trim() != null)
            {
                if (!WJs.IsNum(CLfare_textBox.Text.Trim()) || Convert.ToDouble(CLfare_textBox.Text.Trim()) < 0)
                {
                    WJs.alert("材料费必须为正数!");
                    CLfare_textBox.Focus();
                    return;
                }
            }
            if (NHfare_textBox.Text.Trim() != "" && NHfare_textBox.Text.Trim() != null)
            {
                if (!WJs.IsNum(NHfare_textBox.Text.Trim()) || Convert.ToDouble(NHfare_textBox.Text.Trim()) < 0)
                {
                    WJs.alert("能耗费必须为正数!");
                    NHfare_textBox.Focus();
                    return;
                }
            }
            if (OtherFare_textBox.Text.Trim() != "" && OtherFare_textBox.Text.Trim() != null)
            {
                if (!WJs.IsNum(OtherFare_textBox.Text.Trim()) || Convert.ToDouble(OtherFare_textBox.Text.Trim()) < 0)
                {
                    WJs.alert("其他费用必须为正数!");
                    OtherFare_textBox.Focus();
                    return;
                }
            }
            if (Income_textBox.Text.Trim() != "" && Income_textBox.Text.Trim() != null)
            {
                if (!WJs.IsNum(Income_textBox.Text.Trim()) || Convert.ToDouble(Income_textBox.Text.Trim()) < 0)
                {
                    WJs.alert("营业收入必须为正数!");
                    Income_textBox.Focus();
                    return;
                }
            }

            ActionLoad ac = ActionLoad.Conn();

            ac.Action = "LKWZSVR.lkeq.UseingEQ.EQUseManagSvr";
            ac.Sql    = "AddOrSaveEQUseManage";
            AddInfoForSave(ac);
            ac.ServiceLoad += new YtClient.data.events.LoadEventHandle(ac_ServiceLoad);
            ac.Post();
            if (isOK)
            {
                WJs.alert("保存使用信息成功,即将关闭本窗口……");
                this.Close();
            }
        }
示例#2
0
        private int ModifyWXYanZheng()
        {
            if (RepairDeptId_selText.Text.Trim() == "" || RepairDeptId_selText.Value.Trim() == "")
            {
                WJs.alert("维修必填项:维修科室ID!");
                RepairDeptId_selText.Focus();
                return(1);
            }

            if (repairMan_textBox.Text.Trim() == "")
            {
                WJs.alert("维修必填项:维修人");
                repairMan_textBox.Focus();
                return(1);
            }
            if (RepairTime_textBox.Text.Trim() == "")
            {
                WJs.alert("维修必填项:维修工时");
                RepairTime_textBox.Focus();
                return(1);
            }
            if (!WJs.IsNum(RepairTime_textBox.Text.Trim()) || Convert.ToDouble(RepairTime_textBox.Text.Trim()) < 0)
            {
                WJs.alert("维修工时必须为正数!");
                RepairTime_textBox.Focus();
                return(1);
            }
            if (Repairfare_textBox.Text.Trim() == "")
            {
                WJs.alert("维修必填项:维修费");
                Repairfare_textBox.Focus();
                return(1);
            }

            if (Repairfare_textBox.Text.Trim() != "" && Repairfare_textBox.Text.Trim() != null)
            {
                if (!WJs.IsNum(Repairfare_textBox.Text.Trim()) || Convert.ToDouble(Repairfare_textBox.Text.Trim()) < 0)
                {
                    WJs.alert("维修费必须为正数!");
                    Repairfare_textBox.Focus();
                    return(1);
                }
            }
            if (CLfare_textBox.Text.Trim() != "" && CLfare_textBox.Text.Trim() != null)
            {
                if (!WJs.IsNum(CLfare_textBox.Text.Trim()) || Convert.ToDouble(CLfare_textBox.Text.Trim()) < 0)
                {
                    WJs.alert("材料费必须为正数!");
                    CLfare_textBox.Focus();
                    return(1);
                }
            }
            if (OtherFare_textBox.Text.Trim() != "" && OtherFare_textBox.Text.Trim() != null)
            {
                if (!WJs.IsNum(OtherFare_textBox.Text.Trim()) || Convert.ToDouble(OtherFare_textBox.Text.Trim()) < 0)
                {
                    WJs.alert("其他费用必须为正数!");
                    OtherFare_textBox.Focus();
                    return(1);
                }
            }

            if (CLfare_textBox.Text.Trim() == "")
            {
                WJs.alert("维修必填项:材料费");
                CLfare_textBox.Focus();
                return(1);
            }

            if (OtherFare_textBox.Text.Trim() == "")
            {
                WJs.alert("维修必填项:其他");
                OtherFare_textBox.Focus();
                return(1);
            }
            if (RepairPass_textBox.Text.Trim() == "")
            {
                WJs.alert("维修必填项:维修经过");
                RepairPass_textBox.Focus();
                return(1);
            }
            if (RepairResult_textBox.Text.Trim() == "")
            {
                WJs.alert("维修必填项:维修结果");
                RepairResult_textBox.Focus();
                return(1);
            }
            if (ChangeParts_textBox.Text.Trim() == "")
            {
                WJs.alert("维修必填项:更换部件");
                ChangeParts_textBox.Focus();
                return(1);
            }
            if (Repairdate_dateTimePicker.Value == null)
            {
                WJs.alert("维修必填项:维修日期");
                Repairdate_dateTimePicker.Focus();
                return(1);
            }
            return(0);
        }