Пример #1
0
 public void GetOperator(string cs)
 {
     try
     {
         var pResult   = "";
         var objIncome = new SwiftExpressWSIncome();
         var ds        = objIncome.GetOperator(cs, ref pResult);
         if (pResult == "")
         {
             if (ds.Tables[0].Rows.Count > 0)
             {
                 ASPxComboBox2.DataSource = ds;
                 ASPxComboBox2.TextField  = "NAME_USER";
                 ASPxComboBox2.ValueField = "CORRELATIVE";
                 ASPxComboBox2.DataBind();
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
         }
         objIncome.Dispose();
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
     }
 }
Пример #2
0
        protected void BtnSi_Click(object sender, EventArgs e)
        {
            try
            {
                //Session["SEQUENCE"] = null;

                var objIncome = new SwiftExpressWSIncome();
                var pResult   = "";
                var pError    = "";
                var sequence  = objIncome.GetNextSequence(Session["connectionString"].ToString(), "RECEPTION", ref pResult,
                                                          ref pError);
                if (pError != "")
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + pError + "');", true);
                }

                //CS = Session["connectionString"].ToString();
                _wscalled.UpdateReceptionTemp(Session["Header"].ToString(), Convert.ToString(CbType.Value), Convert.ToString(GrLookProvider.Value), Convert.ToString(GrLookUser.Text), TxtReference.Text, sequence, Session["USER"].ToString(), Session["connectionString"].ToString(), DateAssignedDate.Date, Convert.ToInt32(CbPriority.Value));

                //Ingreso del Header en la tabla General
                _wscalled.InsertInReceptionHeader((int)Session["Header"], MemoComments.Text, Session["connectionString"].ToString());
                //Ingreso del detalle en la tabla General
                _wscalled.InsertInReceptionDetail((int)Session["Header"], Session["connectionString"].ToString());
                //Pregunta quien fue el ultimo insertado en la tabla General y actualiza la tabla general
                _wscalled.GetUltimateValueAndUpdate((int)Session["Header"], Session["connectionString"].ToString());
                Session["SaveReception"] = "true";
                //Eliminar los registros de la Temporal
                _wscalled.DeleteTemp((int)Session["Header"], Session["connectionString"].ToString());
                if (Session["SAP_RECEPTION_DATA"] != null)
                {
                    var ds = (DataSet)Session["SAP_RECEPTION_DATA"];
                    for (var i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        pResult = "";
                        _wscalled.InsertTxnDocSap(Session["connectionString"].ToString(), sequence,
                                                  ds.Tables[0].Rows[i]["ERP_DOC"].ToString(),
                                                  ds.Tables[0].Rows[i]["SKU"].ToString(),
                                                  ds.Tables[0].Rows[i]["QTY"].ToString(),
                                                  ds.Tables[0].Rows[i]["LINE_NUM"].ToString(), ref pResult);
                        if (pResult != "")
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + pResult + "');", true);
                        }
                    }
                }
                ScriptManager.RegisterStartupScript(this, GetType(), "FuncionNJS", "ConnectNJS('" + GrLookUser.Text.ToUpper() + "', 'NEW_TASK')", true);
                ASPxPopupControl1.ShowOnPageLoad = false;
                ClearFields(true);
            }
            catch (Exception ex)
            {
                ASPxPopupControl1.ShowOnPageLoad = false;
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('No se ha realizado la Operacion Correctamente');", true);
            }
        }