예제 #1
0
    /// <summary>
    /// 删除审核操作
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    protected void Repeater_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string msg = "";

        try
        {
            string id = e.CommandArgument.ToString();
            if (e.CommandName == "Del")
            {
                msg = (bool)baseDataManage.CallMethod("Bd_Base_Notice", "DeleteById", null, new Object[] { id }) == true ? "删除成功" : "删除失败";
            }
            else
            {
                IHashObject paramter = new HashObject();
                string      s        = (e.Item.FindControl("UpDateButton") as LinkButton).Text;
                if (s.Equals("审 核"))
                {
                    paramter.Add("CallboardType", 1);
                }
                else if (s.Equals("撤 审"))
                {
                    paramter.Add("CallboardType", 2);
                }
                paramter.Add("id", id);
                msg = (bool)baseDataManage.CallMethod("Bd_Base_Notice", "Update", null, new Object[] { paramter }) == true ? "更新成功" : "更新失败";
            }
            PageDataBind();
        }
        catch (Exception)
        {
            throw;
        }
        ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true);
    }
예제 #2
0
        /// <summary>
        /// 传参数按主键更新数据(参数中必须包含全部主键列)
        /// </summary>
        /// <param name="parameters">全部参数</param>
        /// <param name="changecolumns">需要更新的参数</param>
        /// <param name="offsetParameters">需要偏移更新的参数(update xxx set a=a+@a...)</param>
        /// <returns></returns>
        public int Update(HashObject parameters, string[] changecolumns = null, string[] offsetParameters = null)
        {
            this.CheckForPrimary(parameters);//判断参数中是否包含主键列,如果不包含,抛出异常

            string     hostColName     = DALConfig.GetHostColName(this._dbName);
            HashObject whereParameters = new HashObject();

            whereParameters.Add(this._primaryColumn, parameters[this._primaryColumn]);
            whereParameters.Add(hostColName, parameters[hostColName]);

            HashObject setParameters = new HashObject();

            if (changecolumns != null)
            {
                foreach (string column in changecolumns)
                {
                    setParameters[column] = parameters[column];
                }
            }
            else
            {
                setParameters = parameters.Copy();
                setParameters.Remove(this._primaryColumn); //移除主键列
                setParameters.Remove(hostColName);         //移除分区列
            }

            return(UpdateByWhere(setParameters, whereParameters, offsetParameters));
        }
예제 #3
0
        /// <summary>
        /// 填充新的insert 参数 (按照默认值)
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns></returns>
        private HashObject CreateNewInsertParameters(HashObject parameters)
        {
            HashObject newParameters = new HashObject();

            foreach (KeyValuePair <string, Column> pair in this._allColumns) //循环所有列
            {
                if (pair.Value.Type == "timestamp")                          //timestamp不添加默认值
                {
                    continue;
                }

                if (!parameters.ContainsKey(pair.Key) ||
                    (parameters.ContainsKey(pair.Key) && (parameters[pair.Key] == null || parameters[pair.Key].ToString() == string.Empty))
                    )//不包含或者包含此列单但数据为空则补充默认值
                {
                    newParameters.Add(pair.Key, pair.Value.GetDefaultValue());
                }
                else
                {
                    newParameters.Add(pair.Key, parameters[pair.Key]);
                }
            }

            return(newParameters);
        }
예제 #4
0
        public object GetDownData(string token)
        {
            //UserInfo info = (UserInfo)Session["user"];
            JavaScriptSerializer serializer = JavaScriptSerializer.CreateInstance();

            using (DbHelper db = AppUtils.CreateDbHelper())
            {
                string sql = "select `condition`, user from downtoken where  `token`=@token";
                db.AddParameter("token", token);
                IHashObject data = db.SelectSingleRow(sql);//只用一次
                db.AddParameter("token", token);
                db.AddParameter("ntoken", Guid.NewGuid());
                db.ExecuteIntSQL("update downtoken set `token`=@ntoken where token=@token");
                string user = data.GetValue <string>("user");
                //if (!info.User.Equals(user))
                //{
                //    throw new Exception("非法请求");
                //}
                HashObject condition = serializer.Deserialize <HashObject>(data.GetValue <string>("condition"));

                string     dataSql = WebMain.BillList.list.GetBillSql(db, user, (SearchArea)Enum.Parse(typeof(SearchArea), condition.GetValue <string>("area")));
                HashObject rt      = new HashObject();
                rt.Add("data", db.Select(dataSql));
                rt.Add("captions", new string[] { "订单日期", "姓名", "联系电话", "淘宝账号", "联系地址", "发货信息", "订单状态", "订单回款" });
                rt.Add("fields", new string[] { "date", "cname", "ctel", "taobaocode", "caddress", "sender", "process", "ltotal" });
                return(rt);
            }
        }
예제 #5
0
        private void SendToAnalysis(object billData)
        {
            string         url     = analysisUrl;
            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);

            request.ProtocolVersion        = HttpVersion.Version10;
            request.AutomaticDecompression = DecompressionMethods.GZip;//回传数据被压缩,这里设置自动解压
            request.Accept      = "*/*";
            request.ContentType = "application/json; charset=UTF-8";
            request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br");
            request.Headers.Add(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.8");
            request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36";
            request.Method    = "POST";
            request.Headers.Add("X-JSONFormat", "true");
            HashObject hash = new HashObject();

            hash.Add("user", toUser);
            hash.Add("key", postDataCuid);
            hash.Add("dataList", billData);
            JavaScriptSerializer serializer = JavaScriptSerializer.CreateInstance();

            string data = serializer.Serialize(hash, JavaScriptSerializer.SerializationFormat.JSON);

            byte[] bs = Encoding.UTF8.GetBytes(data);
            request.ContentLength = bs.Length;

            using (Stream reqStream = request.GetRequestStream())
            {
                reqStream.Write(bs, 0, bs.Length);
                reqStream.Flush();
            }
        }
예제 #6
0
        /// <summary>
        /// 直接分析对象数据,把数据转换为单据数据
        /// </summary>
        internal static HashObject AnalysisData(string suser, IList data, CallBackMsg callBack)
        {
            try
            {
                List <CatchDataTemplate> tlist = new List <CatchDataTemplate>();
                foreach (HashObject item in data)
                {
                    tlist.Add(new CatchDataTemplate()
                    {
                        Status = item.GetValue <string>("status"), DetailContent = item.GetValue <HashObject>("detail").GetValue <string>("content")
                    });
                }
                callBack("开始拆分数据");
                DataTable table = TaobaoDataHelper.SpliteContentToDataTable(suser, tlist);
                callBack("数据拆分完成");
                HashObjectList billList   = new HashObjectList();
                HashObjectList detailList = new HashObjectList();

                callBack("开始组装数据");
                BuildBillDataFromTable(suser, false, table, billList, detailList, null, null);
                callBack("数据组装完成");
                HashObject list = new HashObject();
                list.Add("bill", billList);
                list.Add("detail", detailList);
                return(list);
            }
            catch (Exception e)
            {
                callBack(string.Format("Exception:{0}", e.Message));
            }
            return(null);
        }
예제 #7
0
    /// <summary>
    /// 保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbtnPwd_Click(object sender, EventArgs e)
    {
        string msg = "";

        try
        {
            bool retulst = false;

            string oldPwd = PbProject.WebCommon.Web.Cookie.SiteCookie.GetMD5(OldPWD.Text.Trim()); //原支付密码
            string newPwd = PbProject.WebCommon.Web.Cookie.SiteCookie.GetMD5(NewPwd.Text.Trim()); //新支付密码

            if (NewPwd.Text.Trim() != RNewPWD.Text.Trim())
            {
                msg = "两次输入的密码不一致!";
            }

            if (string.IsNullOrEmpty(mCompany.AccountPwd))
            {
                //新设置
            }
            else
            {
                //修改 ,暂时未处理
                if (mCompany.AccountPwd != oldPwd)
                {
                    msg = "原支付密码错误!";
                }
                else if (oldPwd == newPwd)
                {
                    msg = "原支付密码和新支付密码不能一样!";
                }
            }


            if (msg == "")
            {
                HashObject parameter = new HashObject();

                parameter.Add("id", mCompany.id);
                parameter.Add("AccountPwd", newPwd);

                retulst = new PbProject.Logic.User.User_CompanyBLL().UpdateById(parameter);

                if (retulst)
                {
                    msg = "密码修改成功!请重新登录!";
                }
                else
                {
                    msg = "密码修改失败!";
                }
            }
        }
        catch (Exception)
        {
        }

        ScriptManager.RegisterStartupScript(this, GetType(), DateTime.Now.Ticks.ToString(), "showdialog('" + msg + "');", true);
    }
예제 #8
0
    /// <summary>
    /// 保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbsave_Click(object sender, EventArgs e)
    {
        string        msg       = "";
        IHashObject   parameter = new HashObject();
        Log_Operation logoper   = new Log_Operation();

        try
        {
            parameter.Add("OperTime", DateTime.Now);
            parameter.Add("OperLoginName", mUser.LoginName);
            parameter.Add("OperUserName", mUser.UserName);
            parameter.Add("GroupName", txtGroupName.Text.Trim());
            parameter.Add("DefaultFlag", rblDefaultFlag.SelectedValue);
            parameter.Add("UniteFlag", rblUniteFlag.SelectedValue);
            parameter.Add("UnitePoint", txtUnitePoint.Text.Trim());
            if (rblDefaultFlag.SelectedValue == "true")
            {
                new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base().ExecuteNonQuerySQLInfo("Update Tb_Ticket_StrategyGroup set DefaultFlag='false'");
            }
            if (ViewState["id"] != null)
            {
                #region 修改
                parameter.Add("id", ViewState["id"]);
                if ((bool)baseDataManage.CallMethod("Tb_Ticket_StrategyGroup", "Update", null, new object[] { parameter }) == true)
                {
                    msg = "更新成功";
                }
                else
                {
                    msg = "更新失败";
                }
                #endregion
            }
            else
            {
                #region 添加
                parameter.Add("CpyName", mCompany.UninAllName);
                parameter.Add("CpyType", mCompany.RoleType);
                List <Tb_Ticket_StrategyGroup> listgroup = baseDataManage.CallMethod("Tb_Ticket_StrategyGroup", "GetList", null, new Object[] { "GroupName='" + txtGroupName.Text.Trim() + "' and CpyNo='" + mCompany.UninCode + "'" }) as List <Tb_Ticket_StrategyGroup>;
                if (listgroup != null && listgroup.Count > 0)
                {
                    msg = "该用户已存在此扣点组";
                }
                else
                {
                    msg = (bool)baseDataManage.CallMethod("Tb_Ticket_StrategyGroup", "Insert", null, new Object[] { parameter }) == true ? "添加成功" : "添加失败";
                }

                #endregion
            }
        }
        catch (Exception)
        {
            throw;
        }
        ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true);
    }
예제 #9
0
        private object GetLineData(Dictionary <string, Dictionary <string, decimal> > data, List <string> xAxisData)
        {
            HashObject list  = new HashObject();
            HashObject title = new HashObject();

            title.Add("text", "商品销量数量");
            list.Add("title", title);
            HashObject legend = new HashObject();

            legend.Add("data", data.Keys);
            list.Add("legend", legend);
            HashObject xAxis = new HashObject();

            xAxis.Add("data", xAxisData);
            list.Add("xAxis", xAxis);
            HashObject yAxis = new HashObject();

            yAxis.Add("type", "value");
            list.Add("yAxis", yAxis);

            HashObjectList series = new HashObjectList();

            list.Add("series", series);

            foreach (string key in data.Keys)
            {
                Dictionary <string, decimal> chatlist = data[key];

                List <decimal> seriesData = new List <decimal>();
                foreach (string item in xAxisData)
                {
                    if (chatlist.ContainsKey(item))
                    {
                        seriesData.Add(chatlist[item]);
                    }
                    else
                    {
                        seriesData.Add(0);
                    }
                }
                HashObject seriesItem = new HashObject();
                seriesItem.Add("name", key);
                seriesItem.Add("type", "line");
                seriesItem.Add("data", seriesData);
                HashObject normal    = new HashObject();
                HashObject label     = new HashObject();
                HashObject itemStyle = new HashObject();
                label.Add("show", true);
                normal.Add("label", label);
                itemStyle.Add("normal", normal);
                seriesItem.Add("itemStyle", itemStyle);
                series.Add(seriesItem);
            }

            return(list);
        }
예제 #10
0
        /// <summary>
        /// 获取用户信息表
        /// </summary>
        /// <param name="loginName">登录名</param>
        /// <param name="pwdMD5">MD5密码</param>
        /// <param name="loginIp">客户端IP</param>
        /// <returns>返回用户信息表</returns>
        private DataTable[] GetUserTableArray(string loginName, string pwdMD5, string loginIp)
        {
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            DataTable[] userTableArray;
            HashObject  hashParam = new HashObject();

            hashParam.Add("LoginName", loginName);
            hashParam.Add("LoginPwd", pwdMD5);
            hashParam.Add("IsBool", 1);//区分大小写,写死------------------------------
            hashParam.Add("LoginIP", loginIp);
            userTableArray = baseDataManage.MulExecProc("UserLogin", hashParam);
            return(userTableArray);
        }
예제 #11
0
    protected void lbtnPwd_Click(object sender, EventArgs e)
    {
        string msg     = "";
        bool   retulst = false;

        dt = (DataTable)ViewState["dt"];
        try
        {
            string oldPwd = PbProject.WebCommon.Web.Cookie.SiteCookie.GetMD5(OldPWD.Text.Trim());
            string newPwd = PbProject.WebCommon.Web.Cookie.SiteCookie.GetMD5(NewPwd.Text.Trim());
            if (NewPwd.Text.Trim() != RNewPWD.Text.Trim())
            {
                msg = "两次输入的密码不一致!";
            }
            HashObject parameter = new HashObject();
            switch (ViewState["type"].ToString())
            {
            case "updatepwd":
                if (dt.Rows[0]["LoginPassWord"].ToString() != oldPwd)
                {
                    msg = "原密码错误!";
                }
                else if (oldPwd == newPwd)
                {
                    msg = "原密码和新密码不能一样!";
                }
                break;
            }
            if (msg == "")
            {
                parameter.Add("id", dt.Rows[0]["id"]);
                parameter.Add("AccountPwd", newPwd);
                retulst = new PbProject.Logic.User.User_CompanyBLL().UpdateById(parameter);
                if (retulst)
                {
                    msg = "成功!";
                    mCompany.AccountPwd = newPwd;
                }
                else
                {
                    msg = "失败!";
                }
            }
        }
        catch (Exception)
        {
            msg = "操作失败!";
        }

        ScriptManager.RegisterStartupScript(this, GetType(), "456", "showdialog('" + msg + "');", true);
    }
예제 #12
0
파일: Utils.cs 프로젝트: ljbbean/project
        internal static HashObject GetAreaData(SearchArea area)
        {
            HashObject data = new HashObject();

            switch (area)
            {
            case SearchArea.Today:
                data.Add("startDate", DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
                data.Add("endDate", DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
                break;

            case SearchArea.Week:
                int dayofWeek = (int)DateTime.Now.DayOfWeek;
                data.Add("startDate", DateTime.Now.AddDays(-dayofWeek).ToString("yyyy-MM-dd 00:00:00"));
                data.Add("endDate", DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
                break;

            case SearchArea.Month:
                data.Add("startDate", DateTime.Now.ToString("yyyy-MM-01 00:00:00"));
                data.Add("endDate", DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
                break;

            case SearchArea.DaysOf30:
                data.Add("startDate", DateTime.Now.AddDays(-30).ToString("yyyy-MM-01 00:00:00"));
                data.Add("endDate", DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
                break;
            }
            return(data);
        }
예제 #13
0
        public HashObject GetTempData(string id)
        {
            HashObject value;

            if (tempDictionary.TryGetValue(id, out value))
            {
                tempDictionary.Remove(id);
                return(value);
            }
            value = new HashObject();
            value.Add("detail", new HashObjectList());
            value.Add("bill", new HashObjectList());
            return(value);
        }
예제 #14
0
    /// <summary>
    /// 保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string      msg       = "";
        IHashObject parameter = new HashObject();

        try
        {
            parameter.Add("CpyNo", mCompany.UninCode);
            //parameter.Add("RatesMoney",SmsRatesMoney.Text.Trim().Trim());
            parameter.Add("RatesMoney", int.Parse(SmsRatesCount.Text.Trim()) * float.Parse(SmsRatesUnitPrice.Text.Trim()));
            parameter.Add("RatesCount", SmsRatesCount.Text.Trim());
            parameter.Add("RatesUnitPrice", SmsRatesUnitPrice.Text.Trim());
            parameter.Add("RatesRemark", SmsRatesRemark.Text.Trim());
            parameter.Add("RatesState", rblSmsRatesState.SelectedValue);
            parameter.Add("RatesDateTime", DateTime.Now);
            if (ViewState["id"] != null)
            {
                parameter.Add("id", ViewState["id"].ToString());
                msg = (bool)baseDataManage.CallMethod("Tb_Sms_RateSet", "Update", null, new object[] { parameter }) == true ? "修改成功" : "修改失败";
            }
            else
            {
                msg = (bool)baseDataManage.CallMethod("Tb_Sms_RateSet", "Insert", null, new object[] { parameter }) == true ? "添加成功" : "添加失败";
            }
        }
        catch (Exception)
        {
            msg = "操作异常";
        }
        ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true);
    }
예제 #15
0
    public void HandRequest()
    {
        if (Request["CommandName"] != null && Request["CommandName"].ToString() != "")
        {
            string CommandName = Request["CommandName"].ToString();
            string IdList      = Request["IdList"].ToString();
            int    a           = 0;
            try
            {
                if (CommandName == "Del")
                {
                    string[] strArr = IdList.Split(',');
                    if (strArr.Length > 0)
                    {
                        List <string> lst = new List <string>();
                        lst.AddRange(strArr);
                        List <Tb_SpecialCabin_PriceInfo> lstModel = new List <Tb_SpecialCabin_PriceInfo>();
                        IHashObject OutParams = new HashObject();
                        OutParams.Add("2", "out");
                        bool IsDel = (bool)this.baseDataManage.CallMethod("Tb_SpecialCabin_PriceInfo", "DeleteByIds", OutParams, new object[] { lst, lstModel });
                        if (IsDel)
                        {
                            a = 1;
                        }
                    }
                }
                else if (CommandName == "Update")
                {
                    string strSpPrice  = Request["SpPrice"] != null ? Request["SpPrice"].ToString() : "";
                    string strSpABFare = Request["SpABFare"] != null ? Request["SpABFare"].ToString() : "";
                    string strSpRQFare = Request["SpRQFare"] != null ? Request["SpRQFare"].ToString() : "";

                    IHashObject parameter = new HashObject();
                    parameter.Add("SpPrice", strSpPrice);
                    parameter.Add("SpABFare", strSpABFare);
                    parameter.Add("SpRQFare", strSpRQFare);
                    bool IsUpdate = (bool)this.baseDataManage.CallMethod("Tb_SpecialCabin_PriceInfo", "Update", null, new object[] { parameter });
                    if (IsUpdate)
                    {
                        a = 1;
                    }
                }
            }
            catch (Exception)
            {
            }
            OutPut(a.ToString());
        }
    }
예제 #16
0
파일: Login.cs 프로젝트: ljbbean/project
 public HashObject GetBillBeginValue(string user)
 {
     try
     {
         HashObject data = new HashObject();
         data.Add("startDate", GetStartDate(user));
         data.Add("currentDate", MilliTimeStamp(DateTime.Now.AddDays(-1)));
         return(data);
     }
     catch (Exception e)
     {
         Log.Error(string.Format("user:{0}   message:{1}", user, e.Message));
         throw e;
     }
 }
예제 #17
0
 /**
  * 从baseSql抽取系统参数及用户参数
  * 用户参数:{ParamName}
  * 系统参数:{-ParamName-}
  **/
 public void getAllParams(string baseSql, out List<string> userParams, out List<string> sysParams, out IHashObject defaultValue)
 {
     userParams = new List<string>();
     sysParams = new List<string>();
     defaultValue = new HashObject();
     string s = baseSql;
     string[] ss = s.Split('}');
     string[] arry = new string[ss.Length - 1];
     string param = "", value = "";
     int index = -1;
     for (int i = 0; i < ss.Length - 1; i++)
     {
         if (ss[i].IndexOf("{-") > 0)
         {
             arry[i] = ss[i].Substring(ss[i].IndexOf("{-") + 2, ss[i].Length - ss[i].IndexOf("{-")-3);
             param = arry[i];
             index = arry[i].IndexOf("=");
             if (index >= 0)
             {
                 value = param.Substring(index+1);
                 param = param.Substring(0, index);
                 defaultValue.Add(param, value);
             }
             else
             {
                 if (!sysParams.Contains(param))
                     sysParams.Add(arry[i]);
             }
         }
         else
         {
             arry[i] = ss[i].Substring(ss[i].IndexOf("{") + 1, ss[i].Length - ss[i].IndexOf("{")-1);
             param = arry[i];
             index = arry[i].IndexOf("=");
             if (index >= 0)
             {
                 value = param.Substring(index+1);
                 param = param.Substring(0, index);
                 defaultValue.Add(param, value);
             }
             else
             {
                 if (!userParams.Contains(param))
                     userParams.Add(arry[i]);
             }
         }
     }
 }
예제 #18
0
    /// <summary>
    /// 开关预存款
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    protected void repPosList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string msg = "";

        try
        {
            if (e.CommandName.ToString() == "Clear")
            {
                msg = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base().ExecuteNonQuerySQLInfo("update User_Company set AccountPwd='' where unincode='" + e.CommandArgument + "'") == true ? "操作成功" : "操作失败";
            }
            else
            {
                //listParameters = ViewState["listParameters"] as List<Bd_Base_Parameters>;
                listParameters = baseDataManage.CallMethod("Bd_Base_Parameters", "GetList", null, new Object[] { "CpyNo='" + e.CommandArgument + "' and SetName='gongYingKongZhiFenXiao'" }) as List <Bd_Base_Parameters>;
                IHashObject parameter = new HashObject();
                parameter.Add("CpyNo", e.CommandArgument);
                parameter.Add("SetName", "gongYingKongZhiFenXiao");

                parameter.Add("SetDescription", "供应控制分销");
                parameter.Add("StartDate", "2012-12-05 00:00:00.000");
                parameter.Add("EndDate", "2112-12-05 00:00:00.000");
                parameter.Add("Remark", "供应控制分销");
                string types = e.CommandName.ToString();

                if (types == "开启预存款")
                {
                    parameter.Add("SetValue", "|76|");
                    if (listParameters == null || listParameters.Count <= 0)
                    {
                        msg = (bool)baseDataManage.CallMethod("Bd_Base_Parameters", "Insert", null, new Object[] { parameter }) == true ? "操作成功" : "操作失败";
                    }
                    else
                    {
                        msg = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base().ExecuteNonQuerySQLInfo("update Bd_Base_Parameters set SetValue=SetValue+'|76|' where CpyNo='" + e.CommandArgument + "' and SetName='gongYingKongZhiFenXiao'") == true ? "操作成功" : "操作失败";
                    }
                }
                else if (types == "关闭预存款")
                {
                    parameter.Add("SetValue", "");
                    if (listParameters == null || listParameters.Count <= 0)
                    {
                        msg = (bool)baseDataManage.CallMethod("Bd_Base_Parameters", "Insert", null, new Object[] { parameter }) == true ? "操作成功" : "操作失败";
                    }
                    else
                    {
                        msg = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base().ExecuteNonQuerySQLInfo("update Bd_Base_Parameters set SetValue='' where CpyNo='" + e.CommandArgument + "' and SetName='gongYingKongZhiFenXiao'") == true ? "操作成功" : "操作失败";
                    }
                }
            }
            Query();
            BindV_User_Company_List();
        }
        catch (Exception)
        {
            msg = "操作异常";
        }
        ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true);
    }
예제 #19
0
    /// <summary>
    /// 保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbsave_Click(object sender, EventArgs e)
    {
        string      msg       = "";
        IHashObject parameter = new HashObject();

        try
        {
            parameter.Add("OperTime", DateTime.Now);
            parameter.Add("OperLoginName", mUser.LoginName);
            parameter.Add("OperUserName", mUser.UserName);
            parameter.Add("OfficeCode", txtOffice.Text.Trim().ToString());
            parameter.Add("PrintCode", txtPrintCode.Text.Trim().ToString());

            if (ViewState["Id"] != null)
            {
                parameter.Add("id", ViewState["Id"].ToString());
                if ((bool)baseDataManage.CallMethod("Tb_Ticket_PrintOffice", "Update", null, new object[] { parameter }) == true)
                {
                    msg = "更新成功";
                }
                else
                {
                    msg = "更新失败";
                }
            }
            else
            {
                parameter.Add("CpyNo", mCompany.UninCode);
                parameter.Add("CpyName", mCompany.UninAllName);
                parameter.Add("CpyType", mCompany.RoleType);
                parameter.Add("AirCode", txtAirPortCode.Value);
                List <Tb_Ticket_PrintOffice> listprintoffice = baseDataManage.CallMethod("Tb_Ticket_PrintOffice", "GetList", null, new Object[] { "AirCode='" + txtAirPortCode.Text + "' and CpyNo='" + mCompany.UninCode + "'" }) as List <Tb_Ticket_PrintOffice>;
                if (listprintoffice != null && listprintoffice.Count > 0)
                {
                    msg = "此航空公司已设置";
                }
                else
                {
                    msg = (bool)baseDataManage.CallMethod("Tb_Ticket_PrintOffice", "Insert", null, new Object[] { parameter }) == true ? "添加成功" : "添加失败";
                }
            }
        }
        catch (Exception)
        {
            msg = "操作异常";
        }
        ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true);
    }
    private void PageDataBind()
    {
        StringBuilder sbSQLwhere = new StringBuilder();

        sbSQLwhere.AppendFormat(" (ReleaseCpyNo=left('{0}',12) or ReleaseCpyNo=left('{0}',6)) and CallboardType=1  ", mCompany.UninCode);
        //获取已审核 有效公告 内部或者全部公告
        if (mCompany.RoleType == 1)//平台管理员
        {
            // sbSQLwhere.Append(" and (IsInternal=1 or IsInternal=3) ");
        }
        else if (mCompany.RoleType == 2 || mCompany.RoleType == 3)//供应商和落地运营商
        {
            sbSQLwhere.Append(" and (IsInternal=1 or IsInternal=3) ");
        }
        else if (mCompany.RoleType > 3)//采购 分销
        {
            sbSQLwhere.Append(" and (IsInternal=2 or IsInternal=3) ");
        }
        sbSQLwhere.AppendFormat(" and StartDate <= '{0}' and ExpirationDate >= '{1}'", DateTime.Now.ToString(), DateTime.Now.ToString());
        int         TotalCount = 0;
        IHashObject outParams  = new HashObject();

        outParams.Add("1", "out");
        List <Bd_Base_Notice> notice = baseDataManage.CallMethod("Bd_Base_Notice", "GetBasePager1", outParams, new object[] { TotalCount, 10, 1, "*", sbSQLwhere.ToString(), " Emergency " }) as List <Bd_Base_Notice>;

        Repeater.DataSource = notice;
        Repeater.DataBind();
    }
예제 #21
0
        /// <summary>
        /// 根据订单号获取管理员账号和公司信息
        /// </summary>
        /// <param name="OrderId"></param>
        /// <returns></returns>
        public DataTable[] GetUserInfoByOrderId(string OrderId)
        {
            HashObject queryParamter = new HashObject();

            queryParamter.Add("OrderId", OrderId);
            return(MulExecProc("GetUserInfoByOrderId", queryParamter));
        }
예제 #22
0
        /// <summary>
        /// 添加数据库 不缓存数据
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        //public bool NotCacheInsert(IHashObject parameter)
        //{
        //    bool result = false;
        //    using (DbHelper db = new DbHelper(DbControl.GetDbConnStringBasic(DbHandleBehaviorDefine.WRITE, 0)))
        //    {
        //        parameter[this.m_PrimaryFiledKey] = Guid.NewGuid().ToString();
        //        int count = db.Insert(typeof(T).Name, parameter);
        //        if (count > 0)
        //        {
        //            result = true;
        //        }
        //    }
        //    return result;
        //}
        /// <summary>
        /// 添加数据库 不缓存数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        //public bool NotCacheInsert(T model)
        //{
        //    IHashObject parameter = ModelToHashObject(model);
        //    return NotCacheInsert(parameter);
        //}

        /// <summary>
        /// 将实体转换为IHashObject
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public IHashObject ModelToHashObject(T model)
        {
            IHashObject param = new HashObject();
            Type        t     = model.GetType();

            PropertyInfo[] properties = t.GetProperties(BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.GetProperty);
            foreach (PropertyInfo p in properties)
            {
                if (p != null)
                {
                    object[] customAttributes = p.GetCustomAttributes(typeof(SetModelProperty), false);
                    if (customAttributes != null && customAttributes.Length > 0)
                    {
                        SetModelProperty Pty = customAttributes[0] as SetModelProperty;
                        //数据库中不存在的字段不添加
                        if (!Pty.DBIsExistFiled)
                        {
                            continue;
                        }
                    }
                }
                param.Add(p.Name, p.GetValue(model, null));
            }
            return(param);
        }
예제 #23
0
    /// <summary>
    /// 绑定
    /// </summary>
    private void PageDataBind()
    {
        try
        {
            int TotalCount = 0;

            IHashObject outParams = new HashObject();
            string      sqlWhere  = "OrderId in(select OrderId from Tb_Ticket_Passenger where IsBack=0 and OrderId in(select OrderId from Tb_Ticket_Order where " + Con + "))";

            //指定参数类型 第一个参数为out输出类型
            //key 为参数索引从1开始 value为引用类型 out ref
            outParams.Add("1", "out");
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            List <Tb_Ticket_Order> list = baseDataManage.CallMethod("Tb_Ticket_Order", "GetBasePager1", outParams,
                                                                    new object[] { TotalCount, AspNetPager1.PageSize, Curr, "*", sqlWhere, ViewState["orderBy"].ToString() }) as List <Tb_Ticket_Order>;

            TotalCount = outParams.GetValue <int>("1");

            AspNetPager1.RecordCount      = TotalCount;
            AspNetPager1.CurrentPageIndex = Curr;
            AspNetPager1.CustomInfoHTML   = "&nbsp;&nbsp;&nbsp;  页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount;

            repList.DataSource = list;
            repList.DataBind();
        }
        catch (Exception ex)
        {
            repList.DataSource = null;
            repList.DataBind();
        }
    }
예제 #24
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    private void PageDataBind()
    {
        try
        {
            int TotalCount = 0;

            IHashObject outParams = new HashObject();
            //指定参数类型 第一个参数为out输出类型
            //key 为参数索引从1开始 value为引用类型 out ref
            outParams.Add("1", "out");
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            List <Tb_Ticket_Order> list = baseDataManage.CallMethod("Tb_Ticket_Order", "GetBasePager1", outParams,
                                                                    new object[] { TotalCount, AspNetPager1.PageSize, Curr, "*", Con, ViewState["orderBy"].ToString() }) as List <Tb_Ticket_Order>;

            TotalCount = outParams.GetValue <int>("1");

            AspNetPager1.RecordCount      = TotalCount;
            AspNetPager1.CurrentPageIndex = Curr;
            AspNetPager1.CustomInfoHTML   = "&nbsp;&nbsp;&nbsp;  页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount;

            repList.DataSource = list;
            repList.DataBind();
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('页面出错,请从新点击链接!');", true);
        }
    }
예제 #25
0
        /// <summary>
        /// 查询订单
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="parames"></param>
        public override void Query(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            var    pager    = parames["pager"].Split(';');
            int    pageSize = int.Parse(pager[0]);
            int    currPage = int.Parse(pager[1]);
            string con      = SelWhere(parames);
            string orderby  = "  CreateTime desc";

            int         totalCount = 0;
            IHashObject outParams  = new HashObject();

            //指定参数类型 第一个参数为out输出类型
            //key 为参数索引从1开始 value为引用类型 out ref
            outParams.Add("1", "out");
            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            List <Tb_Ticket_Order> list = baseDataManage.CallMethod("Tb_Ticket_Order", "GetBasePager", outParams,
                                                                    new object[] { totalCount, pageSize, currPage, "*,dbo.GetCpyName(CPCpyNo) NewCpCpyName ", con, orderby }) as List <Tb_Ticket_Order>;

            totalCount = outParams.GetValue <int>("1");

            writer.Write(new
            {
                TotalCount = totalCount,
                PageSize   = pageSize,
                List       = list
            });
        }
예제 #26
0
    public void BindData()
    {
        //条件
        Con = Query();

        //分页
        int         TotalCount = 0;
        IHashObject outParams  = new HashObject();

        //指定参数类型 第一个参数为out输出类型
        //key 为参数索引从1开始 value为引用类型 out ref
        outParams.Add("1", "out");
        List <User_Flyer> list = baseDataManage.CallMethod("User_Flyer", "GetBasePager1", outParams, new object[] { TotalCount, AspNetPager1.PageSize, Curr, "*", Con, " id " }) as List <User_Flyer>;

        TotalCount = outParams.GetValue <int>("1");
        AspNetPager1.RecordCount      = TotalCount;
        AspNetPager1.CurrentPageIndex = Curr;
        AspNetPager1.CustomInfoHTML   = "&nbsp;&nbsp;&nbsp;  页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount;


        //不用分页
        // List<User_Flyer> list = baseDataManage.CallMethod("User_Flyer", "GetList", null, new object[] { Con }) as List<User_Flyer>;
        gvflyer.DataSource = list;
        gvflyer.DataBind();

        //设置隐藏域数据
        SetHidVal(list);
    }
예제 #27
0
    protected void lbtnOk_Click(object sender, EventArgs e)
    {
        string msg = "更新失败";

        if (ViewState["id"].ToString().Trim() != "")
        {
            HashObject parametercpy = new HashObject();
            parametercpy.Add("id", ViewState["id"].ToString());
            parametercpy.Add("SetValue", ImportanterGongying.ImportantMarkStr);
            bool rs = (bool)baseDataManage.CallMethod("Bd_Base_Parameters", "Update", null, new object[] { parametercpy });
            if (rs)
            {
                msg = "接口开关更新成功";
            }
        }
        ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialogmsg('" + msg + "');", true);
    }
예제 #28
0
    /// <summary>
    /// 保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbtnPwd_Click(object sender, EventArgs e)
    {
        string msg     = "";
        bool   retulst = false;

        try
        {
            string oldPwd = PbProject.WebCommon.Web.Cookie.SiteCookie.GetMD5(OldPWD.Text.Trim());
            string newPwd = PbProject.WebCommon.Web.Cookie.SiteCookie.GetMD5(NewPwd.Text.Trim());

            if (mUser.LoginPassWord != oldPwd)
            {
                msg = "原密码错误!";
            }
            else if (oldPwd == newPwd)
            {
                msg = "原密码和新密码不能一样!";
            }
            else if (NewPwd.Text.Trim() != RNewPWD.Text.Trim())
            {
                msg = "两次输入的密码不一致!";
            }

            if (msg == "")
            {
                HashObject parameter = new HashObject();
                parameter.Add("id", mUser.id);
                parameter.Add("LoginPassWord", newPwd);
                retulst = new PbProject.Logic.User.User_EmployeesBLL().UpdateById(parameter);
                if (retulst)
                {
                    msg = "密码修改成功!请重新登录!";
                }
                else
                {
                    msg = "密码修改失败!";
                }
            }
        }
        catch (Exception)
        {
            msg = "密码修改失败!";
        }

        ScriptManager.RegisterStartupScript(this, GetType(), "456", "showdialog('" + msg + "');", true);
    }
예제 #29
0
 /**
  * 根据表格中设置的参数的对应值,组装出参数哈希对象
  **/
 private IHashObject getParams()
 {
     IHashObject p = new HashObject();
     for(int i=0; i<dgvParamsSet.RowCount-1; i++)
     {
         if (dgvParamsSet[0, i].Value==null || dgvParamsSet[0, i].Value.ToString() == "") continue;
         p.Add(dgvParamsSet[0, i].Value.ToString(), (dgvParamsSet[1, i].Value==null) ? "": dgvParamsSet[1, i].Value.ToString());
     }
     return p;
 }