示例#1
0
 private DataSet GetParamInfo()
 {
     ParamInfoBLL BLL = new ParamInfoBLL();
     DataSet ds = BLL.GetList(string.Format("ContractID={0} and SlnID={1}", DropGetList.Text.Length == 0 ? "0" : DropGetList.Text, ddlSolution.Text.Length == 0 ? "0" : ddlSolution.Text));
     return ds;
 }
示例#2
0
        private static string GetRequestParams(string sid, string uid, int contractId, int slnId, string clientVersion)
        {
            StringBuilder requestParams = new StringBuilder();
            requestParams.AppendFormat("Sid={0}&Uid={1}&ActionID={2}&ClientVersion={3}&rl=1", sid, uid, contractId, clientVersion);

            DataSet reqParamList = new ParamInfoBLL().GetList(string.Format("ContractID={0} and SlnID={1} and ParamType=1", contractId, slnId));
            DataRowCollection paramRecords = reqParamList.Tables[0].Rows;

            int i = 0;
            foreach (DataRow record in paramRecords)
            {
                if (requestParams.Length > 0)
                {
                    requestParams.Append("&");
                }
                string fieldName = record["Field"].ToString();
                string fieldValue = record["FieldValue"].ToString();

                requestParams.AppendFormat("{0}={1}", fieldName, fieldValue);
                i++;
            }
            return requestParams.ToString();
        }
示例#3
0
 protected void LinkButton1_Command(object sender, CommandEventArgs e)
 {
     int id = Convert.ToInt32(e.CommandArgument.ToString());
     ParamInfoBLL pinfo = new ParamInfoBLL();
     if (pinfo.Delete(id))
     {
         Response.Write("<script language=javascript>alert('删除成功!')</script>");
     }
     else
     {
         Response.Write("<script language=javascript>alert('删除失败!')</script>");
     }
     QueryResult();
 }
示例#4
0
        protected void gvGetlist_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                TableCell cell = gvGetlist.Rows[e.RowIndex].Cells[0];
                ParamInfoModel mode = new ParamInfoModel();
                mode.ID = Convert.ToInt32(((Label)cell.FindControl("IDLabel")).Text.ToString().Trim());
                mode.ContractID = Convert.ToInt32(DropGetList.Text);
                mode.ParamType = Convert.ToInt32(((DropDownList)cell.FindControl("droParamType")).SelectedValue);
                mode.Field = ((TextBox)cell.FindControl("txtField")).Text.ToString().Trim();
                mode.FieldType = Convert.ToInt32(((DropDownList)cell.FindControl("droFieldType")).SelectedValue.ToString().Trim());
                mode.Descption = ((TextBox)cell.FindControl("txtDescption")).Text.ToString().Trim();
                mode.Required = Convert.ToBoolean(((DropDownList)cell.FindControl("droRequired")).SelectedValue);
                mode.Remark = ((TextBox)cell.FindControl("txtRemark")).Text.ToString().Trim();
                mode.SortID = Convert.ToInt32(((TextBox)cell.FindControl("txtSortID")).Text.ToString().Trim());
                mode.FieldValue = ((TextBox)cell.FindControl("txtFieldValue")).Text.ToString().Trim();
                mode.MinValue = Convert.ToInt32(((TextBox)cell.FindControl("txtMinValue")).Text.ToString().Trim());
                mode.MaxValue = Convert.ToInt32(((TextBox)cell.FindControl("txtMaxValue")).Text.ToString().Trim());
                mode.ModifyDate = DateTime.Now;
                ParamInfoBLL Pinfo = new ParamInfoBLL();
                if (Pinfo.Update(mode))
                {
                    gvGetlist.EditIndex = -1;
                    QueryResult();
                }
            }

            catch (Exception erro)
            {
                Response.Write("错误信息:" + erro.Message);
            }
            finally
            {

            }
        }
示例#5
0
 private static DataRowCollection GetResponseFields(string contractId, int slnId)
 {
     DataSet respParamList = new ParamInfoBLL().GetList(string.Format("ContractID={0} and SlnID={1} and ParamType=2", contractId, slnId));
     DataRowCollection respRecords = respParamList.Tables[0].Rows;
     return respRecords;
 }
示例#6
0
        private static string GetRequestParams(string sid, string uid, string contractId, int slnId, string pid, string pwd, string paramList)
        {
            string[] paramArray = null;
            if (paramList != null)
            {
                paramArray = paramList.Split(new char[] { ',', ',', ' ', ';' });
            }

            StringBuilder requestParams = new StringBuilder();
            requestParams.AppendFormat("Sid={0}&Uid={1}&ActionID={2}", sid, uid, contractId);

            DataSet reqParamList = new ParamInfoBLL().GetList(string.Format("ContractID={0} and SlnID={1} and ParamType=1", contractId, slnId));
            DataRowCollection paramRecords = reqParamList.Tables[0].Rows;

            int i = 0;
            foreach (DataRow record in paramRecords)
            {
                if (requestParams.Length > 0)
                {
                    requestParams.Append("&");
                }
                string fieldName = record["Field"].ToString();
                string fieldValue = record["FieldValue"].ToString();

                if (contractId == "1004")
                {
                    if (fieldName.ToLower().Equals("pid"))
                    {
                        fieldValue = string.IsNullOrEmpty(pid)
                                         ? fieldValue
                                         : pid;
                    }
                    else if (fieldName.ToLower().Equals("pwd"))
                    {
                        fieldValue = string.IsNullOrEmpty(pwd)
                                         ? fieldValue
                                         : pwd;
                        fieldValue = new ZyGames.DesSecurity.DESAlgorithmNew().EncodePwd(fieldValue, "n7=7=7dk");
                        fieldValue = HttpUtility.UrlEncode(fieldValue, Encoding.UTF8);
                    }
                }
                else
                {
                    if (paramArray != null && i < paramArray.Length && !string.IsNullOrEmpty(paramArray[i]))
                    {
                        fieldValue = paramArray[i];
                    }
                }
                requestParams.AppendFormat("{0}={1}", fieldName, fieldValue);
                i++;
            }
            return requestParams.ToString();
        }
示例#7
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ParamInfoModel mode = new ParamInfoModel();
            ParamInfoBLL BLL = new ParamInfoBLL();
            mode.Field = txtField.Text.Trim();
            mode.FieldValue = txtFieldValue.Text.Trim();
            mode.Remark = txtRemark.Text.Trim();
            mode.ContractID = ContractID;
            mode.FieldType = Convert.ToInt32(droFieldType.SelectedValue);
            mode.ParamType = Convert.ToInt32(droParamType.SelectedValue);
            mode.Required = Convert.ToBoolean(droRrequired.SelectedValue);
            mode.Descption = txtDescption.Text.Trim();
            mode.SlnID = SlnID;
            mode.MinValue = Convert.ToInt32(txtMinValue.Text.Trim());
            mode.MaxValue = Convert.ToInt32(txtMaxValue.Text.Trim());

            DataSet ds = BLL.GetID(string.Format("ContractID={0} and slnid={1} and ParamType={2}", ContractID, SlnID, mode.ParamType));
            if (ds.Tables[0].Rows[0]["SortID"].ToString() == "")
            {
                mode.SortID = 1;
            }
            else
            {
                int SortID = Convert.ToInt32(ds.Tables[0].Rows[0]["SortID"]);
                SortID++;
                mode.SortID = SortID;

            }

            if (BLL.Add(mode) != 0)
            {
                Response.Redirect(String.Format("index.aspx?ID={0}&slnID={1}", ContractID, mode.SlnID));
            }
            else
            {
                Response.Write("<script language=javascript>alert('增加失败!')</script>");
            }
        }