Beispiel #1
0
        private void FrmDisuse_Approve_Y_Shown(object sender, EventArgs e)
        {
            uC_ApproveList1.InitData(TaskID);
            Hashtable htt = new SqlServerHelper().GetHashtableById("Meter_Disuse", "TaskID", TaskID);

            if (htt.Contains("WATERUSERNO"))
            {
                _waterUserNO = htt["WATERUSERNO"].ToString();
                uC_UserInfos1.InitData(_waterUserNO);
                new SqlServerHelper().BindHashTableToForm(htt, this.panel1.Controls);

                DataTable dt = sysiWb.GetWaterUserFee(_waterUserNO);
                if (DataTableHelper.IsExistRows(dt))
                {
                    Fee.Text = dt.Rows[0][0].ToString();
                }
            }

            string FrmAssemblyName = string.Empty;
            string FormName        = string.Empty;

            if (sysidal.GetAssemblyNameDetail(ht["ResolveID"].ToString(), ref FrmAssemblyName, ref FormName))
            {
                CreateForm.ShowPannel(FormName, FrmAssemblyName, PL_Proc, ht);
            }
        }
Beispiel #2
0
        private void InitView()
        {
            Hashtable htt = new SqlServerHelper().GetHashtableById("Meter_WorkResolve", "ResolveID", ResolveID);

            if (htt != null)
            {
                UserOpinion.Text = htt["USEROPINION"].ToString().Trim();
            }
            htt = new SqlServerHelper().GetHashtableById("Meter_Install_Group", "TaskID", TaskID);
            if (htt.Contains("TASKID"))
            {
                _GroupID    = htt["GROUPID"].ToString();
                MeterCount1 = int.Parse(htt["METERCOUNT"].ToString());

                DataTable dt = new SqlServerHelper().GetDataTable("Meter_GroupMeter", "GroupID='" + _GroupID + "'", "waterMeterSerialNumber");
                if (DataTableHelper.IsExistRows(dt))
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        SMeters.Add(dr["waterMeterSerialNumber"].ToString());
                    }
                }

                BindGroupMeter();
            }
        }
Beispiel #3
0
        private void Btn_Search_Click(object sender, EventArgs e)
        {
            string _DisuseNO = DisuseNO.Text.Trim();

            if (!string.IsNullOrEmpty(_DisuseNO))
            {
                Hashtable ht = new Hashtable();
                ht = new SqlServerHelper().GetHashtableById("Meter_Disuse", "SD", _DisuseNO, "DisuserType=0 AND [STATE]=5");
                ht["DISUSEDATE"] = ht["ACCEPTDATE"];
                new SqlServerHelper().BindHashTableToForm(ht, this.panel1.Controls);
                if (ht.Contains("WATERUSERNO"))
                {
                    DataTable dt = sysidal.GetWaterUserFee(ht["WATERUSERNO"].ToString());
                    if (DataTableHelper.IsExistRows(dt))
                    {
                        LB_Fee.Text = dt.Rows[0][0].ToString();
                        LB_Num.Text = dt.Rows[0][1].ToString();
                    }
                }
                else
                {
                    MessageBox.Show("没有相关用户的报停记录!");
                }
            }
        }
Beispiel #4
0
        private void InitView()
        {
            Hashtable hu = new SqlServerHelper().GetHashtableById("Meter_Install_Group", "TaskID", TaskID);

            if (hu.Contains("METERCOUNT"))
            {
                _GroupID = hu["GROUPID"].ToString();
                if (!string.IsNullOrEmpty(hu["METERCOUNT"].ToString()))
                {
                    _MeterCount     = int.Parse(hu["METERCOUNT"].ToString());
                    MeterCount.Text = hu["METERCOUNT"].ToString();
                    BindMeterSize();
                }
            }

            Hashtable ht = new SqlServerHelper().GetHashtableById("Meter_WorkResolve", "ResolveID", ResolveID);

            if (ht != null)
            {
                UserOpinion.Text = ht["USEROPINION"].ToString().Trim();

                if (ht["MAKESKIP"] != null && ht["MAKEPOINTID"] != null)//是否显示跳转
                {
                    skip = (bool)ht["MAKESKIP"];
                    if (skip)
                    {
                        IsSkip.Visible       = true;
                        LB_GoPointID.Visible = true;
                        CB_GoPointID.Visible = true;
                        string    sqlstr = string.Format("SELECT PointName,PointSort  FROM Meter_WorkPoint WHERE WorkFlowID='{0}' AND PointSort IN ({1}) ORDER BY PointSort", ht["WORKFLOWID"].ToString(), ht["GOPOINTID"].ToString());
                        DataTable dt     = new SqlServerHelper().GetDateTableBySql(sqlstr);
                        ControlBindHelper.BindComboBoxData(this.CB_GoPointID, dt, "PointName", "PointSort");
                    }
                }
                if (!string.IsNullOrEmpty(ht["ISVOIDED"].ToString()))//是否显示报废
                {
                    bool isvisable = false;
                    if (bool.TryParse(ht["ISVOIDED"].ToString(), out isvisable))
                    {
                        Btn_Voided.Visible = isvisable;
                    }
                }

                if (!string.IsNullOrEmpty(ht["ISCHARGE"].ToString()))
                {
                    if (bool.TryParse(ht["ISCHARGE"].ToString(), out IsCharge))
                    {
                        FP_Fee.Visible = IsCharge;
                        //添加收费项目
                        if (IsCharge)
                        {
                            FP_Fee.Controls.Clear();
                            ApproveDispose.BindFeeItemTextBox(this.FP_Fee, ResolveID);
                        }
                    }
                }
            }
        }
        private void uC_DataGridView_Page1_CellDoubleClickEvents(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView dgList = (DataGridView)sender;

            if (dgList.CurrentRow != null)
            {
                object obj = dgList.CurrentRow.Cells["TaskID"].Value;
                if (obj == null || obj == DBNull.Value)
                {
                    return;
                }
                TaskID   = dgList.CurrentRow.Cells["TaskID"].Value.ToString();
                _IsFinal = bool.Parse(dgList.CurrentRow.Cells["IsFinal"].Value.ToString());

                Hashtable ht = new SqlServerHelper().GetHashtableById("Meter_WorkTask", "TaskID", TaskID);
                PointSort = ht["POINTSORT"].ToString();

                Hashtable htt = new SqlServerHelper().GetHashtableById("View_WorkBase", "TaskID", TaskID);
                if (htt.Contains("TABLENAME"))
                {
                    TableName = htt["TABLENAME"].ToString();
                }

                string    sqlstr = string.Format("SELECT * FROM Meter_WorkResolve MWR WHERE MWR.TaskID='{0}' AND PointSort={1} AND IsCashier=1 AND loginId LIKE '%{2}%'", TaskID, PointSort, AppDomain.CurrentDomain.GetData("LOGINID").ToString());
                DataTable dt     = new SqlServerHelper().GetDateTableBySql(sqlstr);
                if (DataTableHelper.IsExistRows(dt))
                {
                    ResolveID = dt.Rows[0]["ResolveID"].ToString();

                    if (_IsFinal)
                    {
                        FrmFinance_Receivable_OP frm = new FrmFinance_Receivable_OP();
                        frm.TaskID    = TaskID;
                        frm.PointSort = PointSort;
                        frm.ResolveID = ResolveID;
                        frm.TableName = TableName;
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            ShowData();
                        }
                    }
                    else
                    {
                        FrmFinance_Receivable_JS frm = new FrmFinance_Receivable_JS();
                        frm.TaskID    = TaskID;
                        frm.PointSort = PointSort;
                        frm.ResolveID = ResolveID;
                        frm.TableName = TableName;
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            ShowData();
                        }
                    }
                }
            }
        }
 private void InitData()
 {
     if (!string.IsNullOrEmpty(BlackID))
     {
         Hashtable ht = new SqlServerHelper().GetHashtableById("User_BlackList", "BlackID", BlackID);
         new SqlServerHelper().BindHashTableToForm(ht, this.panel2.Controls);
         if (ht.Contains("LOGINID"))
         {
             strLogID            = AppDomain.CurrentDomain.GetData("LOGINID").ToString();
             this.panel1.Visible = strLogID.Equals(ht["LOGINID"].ToString());
         }
     }
 }
        public void InitData(string waterUserNO)
        {
            if (!string.IsNullOrEmpty(waterUserNO))
            {
                Hashtable ht = sysidal.GetWaterUserInfoByWaterUserNO(waterUserNO);
                new SqlServerHelper().BindHashTableToForm(ht, this.panel2.Controls);

                Hashtable hts = new SqlServerHelper().GetHashtableById("V_WATERMETER", "waterUserId", waterUserNO);
                if (hts.Contains("WATERMETERSIZEVALUE"))
                {
                    TB_WATERMETERSIZEVALUE.Text = hts["WATERMETERSIZEVALUE"].ToString();
                }
            }
        }
        private void FrmUnsubscribe_Approve_Shown(object sender, EventArgs e)
        {
            uC_ApproveList1.InitData(TaskID);
            Hashtable htt = new SqlServerHelper().GetHashtableById("User_Unsubscribe", "TaskID", TaskID);

            if (htt.Contains("WATERUSERNO"))
            {
                _waterUserNO = htt["WATERUSERNO"].ToString();
                uC_UserInfos1.InitData(_waterUserNO);
                new SqlServerHelper().BindHashTableToForm(htt, this.panel1.Controls);
            }


            string FrmAssemblyName = string.Empty;
            string FormName        = string.Empty;

            if (sysidal.GetAssemblyNameDetail(ht["ResolveID"].ToString(), ref FrmAssemblyName, ref FormName))
            {
                CreateForm.ShowPannel(FormName, FrmAssemblyName, PL_Proc, ht);
            }
        }
        private void Btn_Submit_Click(object sender, EventArgs e)
        {
            Btn_Submit.Enabled = false;

            Hashtable Htask = new Hashtable();

            Htask = new SqlServerHelper().GetHashtableById("Meter_Disuse", "TaskID", TaskID);
            if (Htask.Contains("DISUSERTYPE"))
            {
                _DisuserType = int.Parse(Htask["DISUSERTYPE"].ToString());
            }
            Hashtable Hm = new Hashtable();

            Hm["WATERMETERSTATE"] = _DisuserType == 0 ? 5 : 6;; //5--欠费停水;6-违章停水
            if (new SqlServerHelper().Submit_AddOrEdit("waterMeter", "waterUserId", _waterUserId, Hm))
            {
                //_DisuserType //0-欠费;1-违章
                Hashtable HL = new Hashtable();
                HL["LOGTYPE"]      = 2; //2-水表日志
                HL["LOGCONTENT"]   = string.Format("{2}报停-水表入库-用户号:{0};水表编号:{1}", _waterUserId, _waterMeterId, _DisuserType == 0 ? "欠费" : _DisuserType == 1 ? "违章" : "其它");
                HL["LOGDATETIME"]  = DateTime.Now.ToString();
                HL["OPERATORID"]   = AppDomain.CurrentDomain.GetData("LOGINID").ToString();
                HL["OPERATORNAME"] = AppDomain.CurrentDomain.GetData("USERNAME").ToString();
                HL["MEMO"]         = TaskID;
                new SqlServerHelper().Submit_AddOrEdit("OPERATORLOG", "LOGID", "", HL);

                int count = sysidal.UpdateApprove_defalut("Meter_Disuse", ResolveID, true, UserOpinion.Text.Trim(), PointSort, TaskID, "【水表报停】-水表编号:" + _waterMeterId + "");

                if (count > 0)
                {
                    MessageBox.Show("审批成功!");
                }
                else
                {
                    MessageBox.Show("审批失败!");
                    Btn_Submit.Enabled = true;
                }
            }
        }
Beispiel #10
0
        private void InitView()
        {
            Hashtable htt = new SqlServerHelper().GetHashtableById("Meter_WorkResolve", "ResolveID", ResolveID);

            if (htt != null)
            {
                UserOpinion.Text = htt["USEROPINION"].ToString().Trim();
            }
            htt = new SqlServerHelper().GetHashtableById("Meter_Install_Group", "TaskID", TaskID);
            if (htt.Contains("TASKID"))
            {
                _GroupID             = htt["GROUPID"].ToString();
                WaterUserPeopleCount = int.Parse(htt["WATERUSERPEOPLECOUNT"].ToString());
                _GroupAddress        = htt["WATERUSERADDRESS"].ToString();
                FP.Controls.Clear();

                DataTable dt = sysidal.GetMeter_Group_People(_GroupID, 2);
                if (!DataTableHelper.IsExistRows(dt))
                {
                    dt = sysidal.GetMeter_Group_People(_GroupID, 0);
                }
                BindGroupUser(dt);
            }
        }
        /// <summary>
        /// 打印收条
        /// </summary>
        /// <param name="TaskID"></param>
        /// <param name="_LastPointSort"></param>
        private void PrintReceipt(string TaskID, string _LastPointSort)
        {
            //获取用户基本信息
            Hashtable ht = new SqlServerHelper().GetHashtableById("View_WorkBase", "TaskID", TaskID);

            if (ht.Contains("SD"))
            {
                string _waterUserId      = ht["WATERUSERID"].ToString();
                string _waterUserName    = ht["WATERUSERNAME"].ToString();
                string _SD               = ht["SD"].ToString();
                string _waterUserAddress = ht["WATERUSERADDRESS"].ToString();
                string _TotalFee_CH      = "";//合计大写

                //获取费用合计
                string sqlstr = @"SELECT * FROM 
(SELECT SUM(FEE) AS FEE,InvoiceType AS FEENAME,'0' AS SORT FROM 
(SELECT FEE,(SELECT InvoiceTitle FROM Meter_FeeItmes WHERE FeeID=MWF.FeeID) AS InvoiceType FROM Meter_WorkResolveFee MWF,Meter_WorkResolve MWR 
WHERE MWF.ResolveID=MWR.ResolveID AND MWF.[STATE]=1 
AND MWR.TaskID=@TaskID AND PointSort=@LastPoingSort
) T GROUP BY InvoiceType
UNION ALL
SELECT SUM(CONVERT(decimal,Fee)),'合计','1' FROM Meter_WorkResolveFee MWF,Meter_WorkResolve MWR 
WHERE MWF.ResolveID=MWR.ResolveID AND MWF.[STATE]=1
AND MWR.TaskID=@TaskID AND PointSort=@LastPoingSort) M WHERE FEE<>0";
                //FEE--收费金额
                //FEENAME--收费名称
                DataTable dt = new SqlServerHelper().GetDateTableBySql(sqlstr, new SqlParameter[] { new SqlParameter("@TaskID", TaskID), new SqlParameter("@LastPoingSort", _LastPointSort) });
                if (DataTableHelper.IsExistRows(dt))
                {
                    DataRow[] DR = dt.Select("SORT=1");
                    if (DR.Length.Equals(1))
                    {
                        _TotalFee_CH = RMBHelper.CmycurD(decimal.Parse(DR[0]["FEE"].ToString()));
                    }

                    //====================================打印
                    DataSet   ds     = new DataSet();
                    DataTable dtTemp = dt.Copy();
                    dtTemp.TableName = "收据模板";
                    ds.Tables.Add(dtTemp);
                    FastReport.Report report1 = new FastReport.Report();

                    try
                    {
                        // load the existing report
                        report1.Load(Application.StartupPath + @"\PRINTModel\业扩模板\业扩预算收据模板.frx");

                        (report1.FindObject("txtReceiptNO") as FastReport.TextObject).Text        = "NO." + RECEIPTNO.Text;
                        (report1.FindObject("txtWaterUserNO") as FastReport.TextObject).Text      = "用 户 号:" + _waterUserId;
                        (report1.FindObject("txtSD") as FastReport.TextObject).Text               = "受理编号:" + _SD;
                        (report1.FindObject("txtWaterUserName") as FastReport.TextObject).Text    = "用户名称:" + _waterUserName;
                        (report1.FindObject("txtWaterUserAddress") as FastReport.TextObject).Text = "地    址:" + _waterUserAddress;

                        (report1.FindObject("txtCapMoney") as FastReport.TextObject).Text = "金额大写:" + _TotalFee_CH;
                        (report1.FindObject("txtCasher") as FastReport.TextObject).Text   = "收 款 员:" + strRealName;

                        (report1.FindObject("txtReceiptNO1") as FastReport.TextObject).Text        = "NO." + RECEIPTNO.Text;
                        (report1.FindObject("txtWaterUserNO1") as FastReport.TextObject).Text      = "用 户 号:" + _waterUserId;
                        (report1.FindObject("txtSD1") as FastReport.TextObject).Text               = "受理编号:" + _SD;
                        (report1.FindObject("txtWaterUserName1") as FastReport.TextObject).Text    = "用户名称:" + _waterUserName;
                        (report1.FindObject("txtWaterUserAddress1") as FastReport.TextObject).Text = "地    址:" + _waterUserAddress;

                        (report1.FindObject("txtCapMoney1") as FastReport.TextObject).Text = "金额大写:" + _TotalFee_CH;
                        (report1.FindObject("txtCasher1") as FastReport.TextObject).Text   = "收 款 员:" + strRealName;

                        // register the dataset
                        report1.RegisterData(ds);
                        report1.GetDataSource("收据模板").Enabled = true;
                        //report1.Show();
                        report1.PrintSettings.ShowDialog = false;
                        report1.Prepare();
                        report1.Print();
                    }
                    catch (Exception ex)
                    {
                        mes.Show("收据打印失败:" + ex.Message);
                    }
                }
            }
        }