private string UpdtAsiento()
        {
            var obec = ((BEParameters)Session["InitPar"]);
            var obj  = new BEAsiento();

            obj.Series     = cbbnumero.Text;
            obj.TransId    = Convert.ToInt32(txtTransId.Text);
            obj.DueDate    = Convert.ToDateTime(txtDueDate.Value);
            obj.Memo       = txtmemo.Text;
            obj.Indicator  = Convert.ToString(cbbIndicator.Value);
            obj.Project    = bteProject.Text;
            obj.TransCode  = Convert.ToString(cbbTransCode.Value);
            obj.Ref1       = txtRef1.Text;
            obj.Ref2       = txtRef2.Text;
            obj.Ref3       = txtRef3.Text;
            obj.TipoC      = Convert.ToString(chktipocamb.Value);
            obj.AutoStorno = Convert.ToString(chkanular.Value);
            obj.StornoDate = Convert.ToDateTime(txtanular.Value);
            obj.AdjTran    = Convert.ToString(chkajuste.Value);

            obj.U_GOS_ESTDOC_LE = Convert.ToString(cbbestadodoc.Value);
            obj.U_GOS_FECHA_LE  = txtlibroelec.Text;
            obj.U_MSS_TransIdAD = Convert.ToInt32(txtdocdes.Text);

            obj.Lines = ((List <BEDocumentLine>)Session["asientoPrinc"]);

            using (var obrd = new BRDocument())
            {
                obrd.UpdtAsiento(obj, ((BEParameters)Session["InitPar"]).objSapSbo);
            }
            var _err = !string.IsNullOrWhiteSpace(obj.Msg) ? obj.Msg : "IKCC";

            //Init_VarSessions();
            return(_err);
        }
        private string SaveAsiento()
        {
            var obec = ((BEParameters)Session["InitPar"]);
            var obj  = new BEAsiento();

            obj.Series    = cbbnumero.Text;
            obj.Number    = Convert.ToInt32(cbbnumero.Value);
            obj.RefDate   = Convert.ToDateTime(txtRefDate.Value);
            obj.DueDate   = Convert.ToDateTime(txtDueDate.Value);
            obj.TaxDate   = Convert.ToDateTime(txtTaxDate.Value);
            obj.Memo      = txtmemo.Text;
            obj.Indicator = Convert.ToString(cbbIndicator.Value);
            obj.Project   = bteProject.Text;
            obj.TransCode = Convert.ToString(cbbTransCode.Value);
            obj.Ref1      = txtRef1.Text;
            obj.Ref2      = txtRef2.Text;
            obj.Ref3      = txtRef3.Text;

            if (chktipocamb.Value == "Y")
            {
                obj.Transrate = Convert.ToDecimal(txttipocambio.Text);
            }


            obj.OrignCurr  = Convert.ToString(cbbmoneda.Value);
            obj.StornoDate = Convert.ToDateTime(txtanular.Value);

            obj.AutoStorno = Convert.ToString(chkretencion.Value);
            obj.AdjTran    = Convert.ToString(chkajuste.Value);
            obj.AutoVAT    = Convert.ToString(chkimpu.Value);
            obj.AutoWT     = Convert.ToString(chkretencion.Value);
            obj.TipoC      = Convert.ToString(chktipocamb.Value);

            obj.U_GOS_ESTDOC_LE = Convert.ToString(cbbestadodoc.Value);
            obj.U_GOS_FECHA_LE  = txtlibroelec.Text;
            obj.U_MSS_TransIdAD = Convert.ToInt32(txtdocdes.Text);

            obj.Lines = ((List <BEDocumentLine>)Session["asientoPrinc"]);



            using (var obrd = new BRDocument())
            {
                obrd.SaveAsiento(obj, ((BEParameters)Session["InitPar"]).objSapSbo);
            }
            var _err = !string.IsNullOrWhiteSpace(obj.Msg) ? obj.Msg : string.Format("OKBP", obj.TransId);

            //Init_VarSessions();
            return(_err);
        }