コード例 #1
0
ファイル: edit_ren.aspx.cs プロジェクト: ozotony/patent
    public string updateRenewal(pt.Renewal aa)
    {
        string        connectionString = Connect();
        string        str2             = "";
        SqlConnection connection       = new SqlConnection(connectionString);
        SqlCommand    command          = connection.CreateCommand();

        command.CommandText  = "UPDATE renewal SET title=@title,type=@type,reg_no=@reg_no,app_no=@app_no,app_date=@app_date,xname=@xname ,xmobile=@xmobile ,xemail=@xemail,xaddy=@xaddy,  ";
        command.CommandText += " agt_code=@agt_code,agt_name=@agt_name,agt_addy=@agt_addy,agt_mobile=@agt_mobile,agt_email=@agt_email,last_rwl_date=@last_rwl_date ,reg_date=@reg_date ";
        command.CommandText += " WHERE log_staff=@papp ";
        connection.Open();
        command.Parameters.Add("@title", SqlDbType.NVarChar);
        command.Parameters.Add("@type", SqlDbType.NVarChar);
        command.Parameters.Add("@reg_no", SqlDbType.NVarChar);
        command.Parameters.Add("@app_no", SqlDbType.NVarChar);
        command.Parameters.Add("@app_date", SqlDbType.NVarChar);
        command.Parameters.Add("@xname", SqlDbType.NVarChar);
        command.Parameters.Add("@xmobile", SqlDbType.NVarChar);
        command.Parameters.Add("@xemail", SqlDbType.NVarChar);
        command.Parameters.Add("@xaddy", SqlDbType.Text);

        command.Parameters.Add("@agt_code", SqlDbType.NVarChar);
        command.Parameters.Add("@agt_name", SqlDbType.NVarChar);
        command.Parameters.Add("@agt_addy", SqlDbType.Text);
        command.Parameters.Add("@agt_mobile", SqlDbType.NVarChar);
        command.Parameters.Add("@agt_email", SqlDbType.NVarChar);
        command.Parameters.Add("@last_rwl_date", SqlDbType.NVarChar);
        command.Parameters.Add("@reg_date", SqlDbType.NVarChar);


        command.Parameters.Add("@papp", SqlDbType.NVarChar);
        command.Parameters["@title"].Value    = aa.title;
        command.Parameters["@type"].Value     = aa.type;
        command.Parameters["@reg_no"].Value   = aa.reg_no;
        command.Parameters["@app_no"].Value   = aa.app_no;
        command.Parameters["@app_date"].Value = aa.app_date;
        command.Parameters["@xname"].Value    = aa.xname;
        command.Parameters["@xmobile"].Value  = aa.xmobile;
        command.Parameters["@xemail"].Value   = aa.xemail;
        command.Parameters["@papp"].Value     = aa.log_staff;
        command.Parameters["@xaddy"].Value    = aa.xaddy;

        command.Parameters["@agt_code"].Value      = aa.agt_code;
        command.Parameters["@agt_name"].Value      = aa.agt_name;
        command.Parameters["@agt_addy"].Value      = aa.agt_addy;
        command.Parameters["@agt_mobile"].Value    = aa.agt_mobile;
        command.Parameters["@agt_email"].Value     = aa.agt_email;
        command.Parameters["@last_rwl_date"].Value = aa.last_rwl_date;
        command.Parameters["@reg_date"].Value      = aa.reg_date;

        str2 = command.ExecuteNonQuery().ToString();
        connection.Close();
        string admin = Session["pwalletID"].ToString();

        pt.XPwallet xxs = t.getXPwalletDetailsByID2(TextBox6.Text);
        t.activity_log(admin, "Edit Renewal", "Update", xxs.ID, xxs.data_status, "", "", "", "", "", "");
        return(str2);
    }