// 将通信方法调用接入
        private void Append_CommMethodNav()
        {
            if (commMethod_ComboBox.SelectedItem is null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定要接入的通信方法!";
                return;
            }
            CommMethod commMethod = (CommMethod)commMethod_ComboBox.SelectedItem;
            // 生成通信方法调用的提示字符串并接入
            int    paramNum          = commMethod.Parameters.Count;
            string commMethodCallStr = commMethod.Name + "(";

            if (paramNum == 0)
            {
                commMethodCallStr += ")";
            }
            else
            {
                for (int i = 0; i < paramNum - 1; i++)
                {
                    commMethodCallStr += "?, ";
                }
                commMethodCallStr += "?)";
            }
            Append_Symbol(commMethodCallStr);
        }
        /// <summary>
        /// 根据交款ID得到预交金交款表对象
        /// </summary>
        /// <param name="rpt">预交金交款表对象</param>
        /// <param name="Accountid">交款ID</param>
        public void GetAccountRptInfo(AbstractChargeAccountRpt rpt, int[] Accountids, int type)
        {
            AllAccount Account    = new AllAccount();
            decimal    total_fee  = 0;
            decimal    cash_fee   = 0;
            decimal    pos_fee    = 0;
            decimal    wticketfee = 0;
            decimal    wticketnum = 0;
            decimal    bticketfee = 0;
            decimal    bticketnum = 0;

            CommMethod.list_AddString.Clear();
            List <ZY_Account> zyAccounts = Account.GetAccounts(Accountids, type);
            ZY_Account        zyAccount  = null;

            for (int i = 0; i < zyAccounts.Count; i++)
            {
                zyAccount = zyAccounts[i];

                rpt.交款人     = CommMethod.AddString(zyAccount.AccountName);
                total_fee  += zyAccount.Total_Fee;
                cash_fee   += zyAccount.Cash_Fee;
                pos_fee    += zyAccount.POS_Fee;
                wticketfee += zyAccount.WTicketFee;
                wticketnum += zyAccount.WTicketNum;
                bticketfee += zyAccount.BTicketFee;
                bticketnum += zyAccount.BTicketNum;
            }

            rpt.交款时间  = zyAccount.AccountDate.ToString();
            rpt.总金额   = total_fee.ToString();
            rpt.总金额大写 = total_fee.ToString();

            rpt.现金金额  = cash_fee.ToString();
            rpt.POS金额 = pos_fee.ToString();

            rpt.收费金额 = wticketfee.ToString();
            rpt.收费张数 = wticketnum.ToString();
            rpt.退费金额 = bticketfee.ToString();
            rpt.退费张数 = bticketnum.ToString();

            rpt.次交款时间 = zyAccount.LastDate.ToString();
            rpt.医院名称  = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;

            string[] AccountIDs = new string[Accountids.Length];
            for (int i = 0; i < AccountIDs.Length; i++)
            {
                AccountIDs[i] = Accountids[i].ToString();
            }
            List <ZY_ChargeList> zy_Chargelist = zyAccount.GetChargeData(AccountIDs, -1);

            for (int i = 0; i < zy_Chargelist.Count; i++)
            {
                zy_Chargelist[i].ChargeType = zy_Chargelist[i].FeeType == 0 ? "现金" : "POS";
                zy_Chargelist[i].PatName    = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.GetPatName(zy_Chargelist[i].PatID);
            }
            rpt.预交金记录 = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zy_Chargelist);
        }
        public void Add_CommMethodPair()
        {
            ComboBox processA_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "processA_ComboBox");

            if (processA_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定发送方进程模板!";
                return;
            }
            Process processA = (Process)processA_ComboBox.SelectedItem;

            ComboBox processB_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "processB_ComboBox");

            if (processB_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定接收方进程模板!";
                return;
            }
            Process processB = (Process)processB_ComboBox.SelectedItem;

            ComboBox commMethodA_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "commMethodA_ComboBox");

            if (commMethodA_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定发送方法!";
                return;
            }
            CommMethod commMethodA = (CommMethod)commMethodA_ComboBox.SelectedItem;

            if (commMethodA.InOutSuffix != InOut.Out)
            {
                ResourceManager.mainWindowVM.Tips = "发送方法必须是Out!";
                return;
            }

            ComboBox commMethodB_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "commMethodB_ComboBox");

            if (commMethodB_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定接收方法!";
                return;
            }
            CommMethod commMethodB = (CommMethod)commMethodB_ComboBox.SelectedItem;

            if (commMethodB.InOutSuffix != InOut.In)
            {
                ResourceManager.mainWindowVM.Tips = "接收方法必须是In!";
                return;
            }

            CommMethodPair commMethodPair = new CommMethodPair(processA, commMethodA, processB, commMethodB);

            ((CommChannel_EW_VM)DataContext).CommChannel.CommMethodPairs.Add(commMethodPair);
            ResourceManager.mainWindowVM.Tips = "已添加成员:" + commMethodPair;
        }
Beispiel #4
0
        public void Delete_CommMethod()
        {
            ListBox commMethod_ListBox = ControlExtensions.FindControl <ListBox>(this, "commMethod_ListBox");

            if (commMethod_ListBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定要删除的CommMethod!";
                return;
            }

            CommMethod commMethod = (CommMethod)commMethod_ListBox.SelectedItem;

            ((Process_EW_VM)DataContext).Process.CommMethods.Remove(commMethod);
            ResourceManager.mainWindowVM.Tips = "已删除CommMethod:" + commMethod.ShowString;
        }
Beispiel #5
0
        public void Update_CommMethod()
        {
            ListBox commMethod_ListBox = ControlExtensions.FindControl <ListBox>(this, "commMethod_ListBox");

            if (commMethod_ListBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定要更新的CommMethod!";
                return;
            }

            ComboBox inout_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "inout_ComboBox");

            if (inout_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定CommMethod的输入/输出类型!";
                return;
            }

            TextBox commMethodName_TextBox = ControlExtensions.FindControl <TextBox>(this, "commMethodName_TextBox");

            if (commMethodName_TextBox.Text == null || commMethodName_TextBox.Text.Length == 0)
            {
                ResourceManager.mainWindowVM.Tips = "需要给出CommMethod的方法名!";
                return;
            }

            ObservableCollection <Attribute> parameters = ((Process_EW_VM)DataContext).CommParams;

            if (parameters.Count == 0)
            {
                ResourceManager.mainWindowVM.Tips = "至少要在形参表中添加一个参数!";
                return;
            }

            CommMethod commMethod = new CommMethod(
                commMethodName_TextBox.Text,
                parameters,
                (InOut)inout_ComboBox.SelectedItem
                );

            ((Process_EW_VM)DataContext).Process.CommMethods[commMethod_ListBox.SelectedIndex] = commMethod;
            ResourceManager.mainWindowVM.Tips = "更新了CommMethod:" + commMethod;

            // 更新完成后,要将临时参数列表拿掉,这样再向临时参数列表中添加/更新内容也不会影响刚刚添加的CommMethod
            ((Process_EW_VM)DataContext).CommParams = new ObservableCollection <Attribute>();
        }
        /// <summary>
        /// 根据交款ID得到结算交款表对象
        /// </summary>
        /// <param name="rpt">结算交款表对象</param>
        /// <param name="Accountid">交款ID</param>
        public void GetAccountRptInfo(AbstractCostAccountRpt rpt, int[] Accountids, int type)
        {
            AllAccount        zyAccount  = new AllAccount();
            List <ZY_Account> zyAccounts = zyAccount.GetAccounts(Accountids, type);

            CommMethod.list_AddString.Clear();
            for (int i = 0; i < zyAccounts.Count; i++)
            {
                rpt.交款人 = CommMethod.AddString(zyAccounts[i].AccountName);
            }

            rpt.医院名称 = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName + "住院每日缴款清单";
            rpt.交款时间 = zyAccounts[0].AccountDate.ToString();

            #region 发票项目
            DataTable dt       = zyAccount.GetTicketTotle(Accountids);
            decimal   AllKMFee = 0;
            //dt = null;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                AllKMFee += Convert.ToDecimal(dt.Rows[i]["Tolal_Fee"]);
            }


            #endregion
            rpt.发票项目   = dt;
            rpt.发票科目合计 = AllKMFee.ToString();
            List <ZY_CostMaster> zy_CML = zyAccount.GetCostData(Accountids);
            if (zy_CML != null && zy_CML.Count > 0)
            {
                #region 收费票据

                rpt.收费发票开始号 = zy_CML[0].TicketCode;
                rpt.收费发票结束号 = zy_CML[zy_CML.Count - 1].TicketCode;
                rpt.收费发票张数  = zy_CML.Count.ToString();
                List <ZY_CostMaster> zy_CMLx = zy_CML.FindAll(delegate(ZY_CostMaster x) { return(x.Record_Flag == 2); });
                rpt.收费退费张数 = zy_CMLx.Count.ToString();
                rpt.收费退费金额 = zy_CMLx.Sum(x => x.Total_Fee).ToString();
                rpt.废票张数   = zyAccount.GetBadTicketCount(Accountids).ToString();
                #endregion

                #region 记账部分
                DataTable             dt1  = BaseDataFactory.GetData(baseDataType.病人类型);
                List <AccountPatType> apts = new List <AccountPatType>();
                AccountPatType        apt;
                int AllNum = 0;
                for (int i = 0; i < dt1.Rows.Count; i++)
                {
                    List <ZY_CostMaster> zy_CMLy = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.PatType.Trim() == dt1.Rows[i]["code"].ToString()); });
                    apt          = new AccountPatType();
                    apt.TypeName = dt1.Rows[i]["name"].ToString();
                    apt.CostNum  = zy_CMLy.Count.ToString();
                    apt.CostFee  = zy_CMLy.Sum(x => x.NotWorkUnit_Fee).ToString();
                    apts.Add(apt);
                    AllNum += zy_CMLy.Count;
                }

                apt = new AccountPatType();
                //单位
                List <ZY_CostMaster> zy_CMLy5 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.WorkUnit_Fee != 0); });
                apt.TypeName = "单位";
                apt.CostNum  = zy_CMLy5.Count.ToString();
                apt.CostFee  = zy_CMLy5.Sum(y => y.WorkUnit_Fee).ToString();
                apts.Add(apt);
                //合计
                apt          = new AccountPatType();
                apt.TypeName = "合计";
                apt.CostNum  = (AllNum + zy_CMLy5.Count).ToString();
                apt.CostFee  = zy_CML.Sum(y => y.Village_Fee).ToString();
                apts.Add(apt);

                rpt.记账内容 = apts.ToArray();

                #endregion

                #region 收现金

                rpt.优惠金额 = zy_CML.Sum(z => z.Favor_Fee).ToString();
                rpt.应收金额 = zy_CML.Sum(z => z.Self_Fee).ToString();
                rpt.预收金额 = zy_CML.Sum(z => z.Deptosit_Fee).ToString();
                decimal decR = zy_CML.Sum(z => z.Reality_Fee);
                //补收
                List <ZY_CostMaster> zy_CML11 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Reality_Fee > 0); });
                //补退
                List <ZY_CostMaster> zy_CML22 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Reality_Fee < 0); });
                //欠费
                List <ZY_CostMaster> zy_CML33 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Ntype == 3); });

                rpt.补收金额 = zy_CML11.Sum(x => x.Reality_Fee).ToString("0.00");
                rpt.补退金额 = (0 - zy_CML22.Sum(x => x.Reality_Fee)).ToString("0.00");
                rpt.实收金额 = decR.ToString();
                rpt.小写合计 = decR.ToString();
                rpt.大写合计 = decR.ToString();

                List <ZY_ChargeList> zy_cl = zyAccount.GetChargeListData(Accountids);
                //现金
                List <ZY_ChargeList> zy_cl0 = zy_cl.FindAll(x => x.FeeType == 0);
                //POS
                List <ZY_ChargeList> zy_cl1 = zy_cl.FindAll(x => x.FeeType == 1);
                rpt.预交金现金   = zy_cl0.Sum(x => x.Total_Fee).ToString();
                rpt.预交金POS  = zy_cl1.Sum(x => x.Total_Fee).ToString();
                rpt.补收金额现金  = zy_CML11.Sum(x => x.Money_Fee).ToString();
                rpt.补收金额POS = zy_CML11.Sum(x => x.Pos_Fee).ToString();
                rpt.费金额     = zy_CML33.Sum(x => (x.Self_Fee - x.Deptosit_Fee)).ToString();
                #endregion
            }
        }
Beispiel #7
0
        public void Update_CommMethod()
        {
            ListBox commMethod_ListBox = ControlExtensions.FindControl <ListBox>(this, "commMethod_ListBox");

            if (commMethod_ListBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定要更新的CommMethod!";
                return;
            }

            ComboBox commWay_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "commWay_ComboBox");

            if (commWay_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定CommMethod的通信方式!";
                return;
            }

            ComboBox inout_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "inout_ComboBox");

            if (inout_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定CommMethod的输入/输出类型!";
                return;
            }

            TextBox commMethodName_TextBox = ControlExtensions.FindControl <TextBox>(this, "commMethodName_TextBox");

            if (commMethodName_TextBox.Text == null || commMethodName_TextBox.Text.Length == 0)
            {
                ResourceManager.mainWindowVM.Tips = "需要给出CommMethod的方法名!";
                return;
            }

            ObservableCollection <Attribute> parameters = ((Process_EW_VM)DataContext).CommParams;

            if (parameters.Count == 0)
            {
                ResourceManager.mainWindowVM.Tips = "至少要在形参表中添加一个参数!";
                return;
            }

            CommMethod commMethod = (CommMethod)commMethod_ListBox.SelectedItem;

            if (commMethodName_TextBox.Text != commMethod.Name && Checker.Process_Contain_PropName(VM.Process, commMethodName_TextBox.Text))
            {
                ResourceManager.mainWindowVM.Tips = "标识符重复!";
                return;
            }

            // 类型号
            TextBox typeId_TextBox = ControlExtensions.FindControl <TextBox>(this, nameof(typeId_TextBox));

            if (typeId_TextBox.Text == null)
            {
                typeId_TextBox.Text = "";
            }

            commMethod.Name                   = commMethodName_TextBox.Text;
            commMethod.Parameters             = parameters;
            commMethod.InOutSuffix            = (InOut)inout_ComboBox.SelectedItem;
            commMethod.CommWay                = (CommWay)commWay_ComboBox.SelectedItem;
            commMethod.TypeId                 = typeId_TextBox.Text; // 类型号
            ResourceManager.mainWindowVM.Tips = "更新了CommMethod:" + commMethod.ShowString;

            // 更新完成后,要将临时参数列表拿掉,这样再向临时参数列表中添加/更新内容也不会影响刚刚添加的CommMethod
            ((Process_EW_VM)DataContext).CommParams = new ObservableCollection <Attribute>();
        }
Beispiel #8
0
        public void Add_CommMethod()
        {
            ComboBox commWay_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "commWay_ComboBox");

            if (commWay_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定CommMethod的通信方式!";
                return;
            }

            ComboBox inout_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "inout_ComboBox");

            if (inout_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定CommMethod的输入/输出类型!";
                return;
            }

            TextBox commMethodName_TextBox = ControlExtensions.FindControl <TextBox>(this, "commMethodName_TextBox");

            if (commMethodName_TextBox.Text == null || commMethodName_TextBox.Text.Length == 0)
            {
                ResourceManager.mainWindowVM.Tips = "需要给出CommMethod的方法名!";
                return;
            }

            // 类型号
            TextBox typeId_TextBox = ControlExtensions.FindControl <TextBox>(this, nameof(typeId_TextBox));

            if (typeId_TextBox.Text == null)
            {
                typeId_TextBox.Text = "";
            }

            if (Checker.Process_Contain_PropName(VM.Process, commMethodName_TextBox.Text))
            {
                ResourceManager.mainWindowVM.Tips = "标识符重复!";
                return;
            }

            ObservableCollection <Attribute> parameters = ((Process_EW_VM)DataContext).CommParams;

            if (parameters.Count == 0)
            {
                ResourceManager.mainWindowVM.Tips = "至少要在形参表中添加一个参数!";
                return;
            }

            CommMethod commMethod = new CommMethod(
                commMethodName_TextBox.Text,
                parameters,
                (InOut)inout_ComboBox.SelectedItem,
                (CommWay)commWay_ComboBox.SelectedItem
                );

            commMethod.TypeId = typeId_TextBox.Text; // 类型号

            ((Process_EW_VM)DataContext).Process.CommMethods.Add(commMethod);
            ResourceManager.mainWindowVM.Tips = "添加了CommMethod:" + commMethod.ShowString;

            // 添加完成后,要将临时参数列表拿掉,这样再向临时参数列表中添加/更新内容也不会影响刚刚添加的CommMethod
            // ((Process_EW_VM)DataContext).CommParams = new ObservableCollection<Attribute>();

            // 【11月10日bugfix】更新完成后,将这个临时参数表复制一份保留
            ObservableCollection <Attribute> tmp = new ObservableCollection <Attribute>();

            foreach (Attribute attribute in ((Process_EW_VM)DataContext).CommParams)
            {
                tmp.Add(new Attribute(attribute));
            }
            ((Process_EW_VM)DataContext).CommParams = tmp;
        }
Beispiel #9
0
        /// <summary>
        ///根据结算ID数组得到预交金对象集(交款表汇总-打印结算交款表用)
        /// </summary>
        /// <param name="AccountID"></param>
        /// <returns></returns>
        public List <ZY_ChargeList> GetChargeListData(int[] AccountIDs)
        {
            string strWhere = " DELETE_FLAG in (select costmasterid from zy_costmaster where accountid in (" + CommMethod.ToString(AccountIDs) + ") ) ";

            return(BindEntity <ZY_ChargeList> .CreateInstanceDAL(oleDb).GetListArray(strWhere));
        }
Beispiel #10
0
        /// <summary>
        /// 根据结算ID数组得到结算对象集(交款表汇总-打印结算交款表用)
        /// </summary>
        /// <param name="AccountID"></param>
        /// <returns></returns>
        public List <ZY_CostMaster> GetCostData(int[] AccountIDs)
        {
            string strWhere = "ACCOUNTID in (" + CommMethod.ToString(AccountIDs) + ")" + oleDb.OrderBy("ACCOUNTID");

            return(BindEntity <ZY_CostMaster> .CreateInstanceDAL(oleDb).GetListArray(strWhere));
        }
Beispiel #11
0
        public decimal[] GetTotleType(int[] AccountIDs)
        {
            decimal[] dec    = new decimal[3];
            string    strsql = @"select sum(TOTAL_FEE) as tolal_fee 
                              from {ZY_COSTORDER}  where   COSTID  IN( (select COSTMASTERID from {ZY_COSTMASTER} where   ACCOUNTID in (" + CommMethod.ToString(AccountIDs) + @") )  ) and BIGITEMCODE in ('00','01','02','03')";
            object    obj    = oleDb.GetDataResult(strsql);

            dec[0] = obj == null ? 0 : Convert.ToDecimal(obj);
            strsql = @"select sum(TOTAL_FEE) as tolal_fee 
                              from {ZY_COSTORDER}  where   COSTID  IN( (select COSTMASTERID from {ZY_COSTMASTER} where   ACCOUNTID in (" + CommMethod.ToString(AccountIDs) + @") )  ) and BIGITEMCODE not in ('00','01','02','03')";
            obj    = oleDb.GetDataResult(strsql);
            dec[1] = obj == null ? 0 : Convert.ToDecimal(obj);
            dec[2] = 0;
            return(dec);
        }
Beispiel #12
0
        /// <summary>
        /// 根据结算ID数组得到交款对象集(交款表汇总-打印结算交款表用)
        /// </summary>
        /// <param name="AccountIDs">结算ID数组</param>
        /// <returns>交款对象集</returns>
        public List <ZY_Account> GetAccounts(int[] AccountIDs, int type)
        {
            List <ZY_Account> zyAccounts = BindEntity <ZY_Account> .CreateInstanceDAL(oleDb).GetListArray(" AccountType=" + type + " and  accountid in (" + CommMethod.ToString(AccountIDs) + ")");

            for (int i = 0; i < zyAccounts.Count; i++)
            {
                zyAccounts[i].AccountName = BaseNameFactory.GetName(baseNameType.用户名称, zyAccounts[i].AccountCode);
            }
            return(zyAccounts);
        }
Beispiel #13
0
    /// <summary>
    ///添加(修改)操作
    /// </summary>
    private void AddInfo()
    {
        string sql = "";

        int adKind = 0, display = 0;

        if (yFlash.Checked == true)
        {
            adKind = 1;
        }
        else
        {
            adKind = 0;
        }
        if (nDisplay.Checked == true)
        {
            display = 1;
        }
        else
        {
            display = 0;
        }

        //品牌图片路径
        string[] uploadeAddress = null;

        //上传的文件名
        string[] filename       = null;

        long maxSize = long.Parse(ConfigurationManager.AppSettings.Get("newsPicSize"));

        string message = CommMethod.uploadFile(HttpContext.Current.Server.MapPath("~/upload_pic"), null, ".jpg.gif.png.bmp.swf", maxSize, out uploadeAddress, out filename);

        string picurl = "upload_pic" + uploadeAddress[0];


        if (id == 0)
        {
            if (uploadeAddress[0] != null)
            {
                sql = "insert into FY_advertise(adKind,adPath,adPx,adPosition,adDetail,adCompany,addtime,title,linkUrl,display) values(" + adKind + ",'" + Sys.filterSQLStr(picurl) + "','"
                      + Sys.filterSQLStr(txtadPx.Text.Trim()) + "','" + Sys.filterSQLStr(txtadPosition.Value.Trim()) + "','" + Sys.filterSQLStr(txtadDetail.Text.Trim()) + "','"
                      + Sys.filterSQLStr(txtadCompany.Value.Trim()) + "',getdate(),'" + Sys.filterSQLStr(this.txt_title.Value.Trim()) + "','" + Sys.filterSQLStr(this.txt_linkUrl.Value.Trim()) + "'," + display + ")";

                int succtag = SqlHelper.ExecuteNonQuery(SqlHelper.ConnString_insert, CommandType.Text, sql);

                if (succtag > 0)
                {
                    succtag = 1;
                    scripthelp.AlertAndRedirect("保存操作成功!", "ad_list.aspx", this.Page);
                }
                else
                {
                    scripthelp.Alert("保存操作失败!", this.Page);
                    return;
                }
            }
            else
            {
                scripthelp.Alert(message, this.Page);
                return;
            }
        }
        else
        {
            if (uploadeAddress[0] == null)
            {
                picurl = this.oldPic.Value;
                if (string.IsNullOrEmpty(picurl))
                {
                    scripthelp.Alert("上传的文件不能为空!", this.Page);
                    return;
                }
            }
            string str = "select * from FY_advertise where id=" + Convert.ToInt32(Request.QueryString["id"].ToString());

            DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.ConnString_select, CommandType.Text, str).Tables[0];

            if (dt.Rows.Count < 0)
            {
                return;
            }
            else
            {
                string adPath = dt.Rows[0]["adPath"].ToString();

                if (File.Exists(Server.MapPath(adPath)))
                {
                    File.Delete(Server.MapPath(adPath));
                }
            }

            sql = "update FY_advertise set adKind=" + adKind + ",adPath='" + picurl + "',"
                  + "adPx='" + Sys.filterSQLStr(txtadPx.Text.Trim()) + "',adPosition='" + Sys.filterSQLStr(txtadPosition.Value.Trim()) + "',"
                  + "adDetail='" + Sys.filterSQLStr(txtadDetail.Text.Trim()) + "',adCompany='" + Sys.filterSQLStr(txtadCompany.Value.Trim()) + "',"
                  + "addtime=getdate(),title='" + Sys.filterSQLStr(txt_title.Value.Trim()) + "',linkUrl='" + Sys.filterSQLStr(txt_linkUrl.Value.Trim()) + "',display=" + display + "  where id =" + id + "";


            int succtag = SqlHelper.ExecuteNonQuery(SqlHelper.ConnString_insert, CommandType.Text, sql);

            if (succtag > 0)
            {
                succtag = 1;
                scripthelp.AlertAndRedirect("保存操作成功!", "ad_list.aspx", this.Page);
            }
            else
            {
                scripthelp.Alert("保存操作失败!", this.Page);
                return;
            }
        }
    }
        public void Update_CommMethodPair()
        {
            ListBox commMethodPair_ListBox = ControlExtensions.FindControl <ListBox>(this, "commMethodPair_ListBox");

            if (commMethodPair_ListBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要在域内成员列表中选定要修改的成员!";
                return;
            }

            ComboBox processA_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "processA_ComboBox");

            if (processA_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定发送方进程模板!";
                return;
            }
            Process processA = (Process)processA_ComboBox.SelectedItem;

            ComboBox processB_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "processB_ComboBox");

            if (processB_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定接收方进程模板!";
                return;
            }
            Process processB = (Process)processB_ComboBox.SelectedItem;

            ComboBox commMethodA_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "commMethodA_ComboBox");

            if (commMethodA_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定发送方法!";
                return;
            }
            CommMethod commMethodA = (CommMethod)commMethodA_ComboBox.SelectedItem;

            if (commMethodA.InOutSuffix != InOut.Out)
            {
                ResourceManager.mainWindowVM.Tips = "发送方法必须是Out!";
                return;
            }

            ComboBox commMethodB_ComboBox = ControlExtensions.FindControl <ComboBox>(this, "commMethodB_ComboBox");

            if (commMethodB_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定接收方法!";
                return;
            }
            CommMethod commMethodB = (CommMethod)commMethodB_ComboBox.SelectedItem;

            if (commMethodB.InOutSuffix != InOut.In)
            {
                ResourceManager.mainWindowVM.Tips = "接收方法必须是In!";
                return;
            }

            CommMethodPair commMethodPair = (CommMethodPair)commMethodPair_ListBox.SelectedItem;

            commMethodPair.ProcessA           = processA;
            commMethodPair.CommMethodA        = commMethodA;
            commMethodPair.ProcessB           = processB;
            commMethodPair.CommMethodB        = commMethodB;
            ResourceManager.mainWindowVM.Tips = "已更新成员:" + commMethodPair;
        }
Beispiel #15
0
        public System.Data.DataTable GetTicketTotle(int[] AccountIDs)
        {
            string strsql = @"select itemname,sum(tolal_fee) as tolal_fee 
                            from  
                            (select  (select  itemname  from  (select a.CODE,b.ITEM_NAME as itemname from {base_stat_item as a},{base_stat_zyfp as b} where   a.ZYFP_CODE = b.code ) aa  where    aa.code   = BIGITEMCODE   ) itemname , 
                            SUM(TOTAL_FEE)   as tolal_fee 
                            from {ZY_COSTORDER}
                            where   COSTID  IN( (select COSTMASTERID from {ZY_COSTMASTER} where   ACCOUNTID in (" + CommMethod.ToString(AccountIDs) + @") )  ) 
                            Group BY BIGITEMCODE ) a  group by itemname  ";

            //strsql = String.Format(strsql, AccountID);
            return(oleDb.GetDataTable(strsql));
        }
Beispiel #16
0
        /// <summary>
        /// 根据结算ID数组得到得到废票张数(交款表汇总-打印结算交款表用)
        /// </summary>
        /// <param name="AccountID"></param>
        /// <returns></returns>
        public int GetBadTicketCount(int[] AccountIDs)
        {
            string strWhere = "ACCOUNTID in (" + CommMethod.ToString(AccountIDs) + ")";

            return(Convert.ToInt32(BindEntity <object> .CreateInstanceDAL(oleDb, "ZY_BADTICKET").GetFieldValue("count(*)", strWhere)));
        }
Beispiel #17
0
        public void FileRequest(IPEndPoint remote, string path)
        {
            DialogResult dr           = MessageBox.Show("是否保存文件:是[保存并打开],否[仅打开]", "选择", MessageBoxButtons.YesNoCancel);
            string       fileSavePath = "";

            if (dr == DialogResult.Yes)
            {
                SaveFileDialog sfdlg = new SaveFileDialog();
                sfdlg.DefaultExt       = path.Substring(path.LastIndexOf("."));
                sfdlg.RestoreDirectory = true;
                if (sfdlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    fileSavePath = sfdlg.FileName;
                }
            }
            else if (dr == DialogResult.No)
            {
                int loca = path.LastIndexOf('\\');
                //int DateTime.Now.ToString format, fff... stands for milliseconds
                //for example ss-ffff:57-2141
                fileSavePath = recvTmpPath + "\\" + DateTime.Now.ToString("yyyyMMddHHmmss") + "_";
                string fileSaveName;
                while (true)
                {
                    fileSaveName = CommMethod.RandString(4) + "_";
                    if (loca > 0)
                    {
                        fileSaveName += path.Substring(loca + 1);
                    }
                    else
                    {
                        fileSaveName += path;
                    }
                    FileInfo fs = new FileInfo(fileSavePath + fileSaveName);
                    if (!fs.Exists)
                    {
                        fileSavePath += fileSaveName;
                        break;
                    }
                }
            }
            else
            {
                return;
            }
            FileWaitObjcet fwo = new FileWaitObjcet();

            fwo.ID       = CommMethod.RandString(FileWaitObjcet.IDLength);
            fwo.SavePath = fileSavePath;

            fileWaitMutex.WaitOne();
            while (dicFileWait.ContainsKey(fwo.ID))
            {
                fwo.ID = CommMethod.RandString(FileWaitObjcet.IDLength);
            }
            dicFileWait.Add(fwo.ID, fwo);
            fileWaitMutex.ReleaseMutex();

            FileRequestObjcet fro = new FileRequestObjcet(fwo.ID, netc.LocalFileRecvIEP, path);

            netc.SendTCPString(remote, FileRequestHead + fro.ToString());
        }
        public void Update_CommMethodPair()
        {
            if (commMethodPair_ListBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要在通信方法序对列表中选定要修改的成员!";
                return;
            }

            if (processA_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定发送方进程模板!";
                return;
            }
            Process processA = (Process)processA_ComboBox.SelectedItem;

            if (processB_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定接收方进程模板!";
                return;
            }
            Process processB = (Process)processB_ComboBox.SelectedItem;

            if (commMethodA_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定发送方法!";
                return;
            }
            CommMethod commMethodA = (CommMethod)commMethodA_ComboBox.SelectedItem;

            if (commMethodA.InOutSuffix != InOut.Out)
            {
                ResourceManager.mainWindowVM.Tips = "发送方法必须是Out!";
                return;
            }

            if (commMethodB_ComboBox.SelectedItem == null)
            {
                ResourceManager.mainWindowVM.Tips = "需要选定接收方法!";
                return;
            }
            CommMethod commMethodB = (CommMethod)commMethodB_ComboBox.SelectedItem;

            if (commMethodB.InOutSuffix != InOut.In)
            {
                ResourceManager.mainWindowVM.Tips = "接收方法必须是In!";
                return;
            }

            ObservableCollection <CommMethodPair> commMethodPairs = VM.CommChannel.CommMethodPairs;

            // 判重
            foreach (CommMethodPair cmp in commMethodPairs)
            {
                if (
                    cmp.ProcessA == processA &&
                    cmp.ProcessB == processB &&
                    cmp.CommMethodA == commMethodA &&
                    cmp.CommMethodB == commMethodB
                    )
                {
                    ResourceManager.mainWindowVM.Tips = "无效的操作。该通信方法序对已经添加过";
                    return;
                }
            }

            bool privacy = privacy_CheckBox.IsChecked == null ? false : (bool)privacy_CheckBox.IsChecked;

            CommMethodPair commMethodPair = (CommMethodPair)commMethodPair_ListBox.SelectedItem;

            commMethodPair.ProcessA           = processA;
            commMethodPair.CommMethodA        = commMethodA;
            commMethodPair.ProcessB           = processB;
            commMethodPair.CommMethodB        = commMethodB;
            commMethodPair.Privacy            = privacy;
            ResourceManager.mainWindowVM.Tips = "已更新成员:" + commMethodPair;
        }