コード例 #1
0
ファイル: clsSLDAL.cs プロジェクト: saumyabrata/FinSoft2017
        public string UpdateData(clsSLBO SlBO)
        {
            SqlCommand cmd = new SqlCommand();
            String     Result;

            cmd.CommandText = "Update TblSLMast set SL_L_NAME=@SL_L_NAME,SLADD1=@SLADD1,SLADD2=@SLADD2,SLCITY=@SLCITY,SLPIN=@SLPIN,SLFAX=@SLFAX,SLPHONE=@SLPHONE,SLCONT_PERS=@SLCONT_PERS,REMARKS=@REMARKS,OP_BAL=@OP_BAL,STATUS=@STATUS,GSTIN=@GSTIN where SLID = '" + SlBO.GetSLID() + "' and BrCode='" + Global.branch + "' and finyr='" + Global.finyr + "'";

            cmd.Connection = clsConnection.Conn;
            try
            {
                cmd.Parameters.AddWithValue("@Finyr", SlBO.Getfinyr());
                cmd.Parameters.AddWithValue("@BrCode", SlBO.GetBrCode());
                cmd.Parameters.AddWithValue("@GLID", SlBO.GetGLID());
                cmd.Parameters.AddWithValue("@SLID", SlBO.GetSLID());
                cmd.Parameters.AddWithValue("@SL_L_NAME", SlBO.GetSL_L_NAME());
                cmd.Parameters.AddWithValue("@SLADD1", SlBO.GetSLADD1());
                cmd.Parameters.AddWithValue("@SLADD2", SlBO.GetSLADD2());
                cmd.Parameters.AddWithValue("@SLCITY", SlBO.GetSLCITY());
                cmd.Parameters.AddWithValue("@SLPIN", SlBO.GetSLPIN());
                cmd.Parameters.AddWithValue("@SLFAX", SlBO.GetSLFAX());
                cmd.Parameters.AddWithValue("@SLPHONE", SlBO.GetSLPHONE());
                cmd.Parameters.AddWithValue("@SLCONT_PERS", SlBO.GetSLCONT_PERS());
                cmd.Parameters.AddWithValue("@REMARKS", SlBO.GetREMARKS());
                cmd.Parameters.AddWithValue("@op_bal", SlBO.Getop_bal());
                cmd.Parameters.AddWithValue("@STATUS", SlBO.GetSTATUS());
                cmd.Parameters.AddWithValue("@GSTIN", SlBO.Getgstin());
                cmd.ExecuteNonQuery();
                Result = "Record Updated Successfully";
            }

            catch (Exception ex)
            {
                Result = ex.Message;
            }
            cmd.Dispose();
            return(Result);
        }