Beispiel #1
0
        public void SBO_Application_MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;

            ContextMenu contextMenu = ContextMenu.GetObj;

            if (pVal.BeforeAction)
            {
                if (pVal.MenuUID == "3591")
                {
                    contextMenu.Clear();
                    contextMenu.CreateMenu(string.Format("Учет запчастей/расходников и краски"));
                }

                if (pVal.MenuUID == "subMenu0")
                {
                    // Заполнение формы, которая сейчас откроется
                    string id = ((SAPbouiCOM.EditText)UIApp.Forms.ActiveForm.Items.Item("lab2").Specific).Value;

                    initData = AdoNetQueries.GetEqCard(id);

                    //contextMenu.Clear();

                    SAPbouiCOM.Framework.Application.SBO_Application.ActivateMenuItem("47620");

                    //var f = new Form1(a);
                    //f.Show();
                    //var f = new UDOForm2(a.internalSN, a.custmrName, a.itemName);
                }
            }
        }
Beispiel #2
0
        //public Grid grid1 { get; set; }

        public Form1(dataFromOINS a)
        //public Form1(string sn, string bpName, string itemName, string itemCode, string bpCode, string createDate, string docEntry)
        {
            a.createDate = a.createDate.Substring(0, a.createDate.LastIndexOf(" "));

            EditText5.Value = a.internalSN;
            EditText3.Value = a.custmrName;
            EditText4.Value = a.itemName;

            EditText8.Value  = a.customer;
            EditText10.Value = a.itemCode;
            EditText6.Value  = a.createDate;

            EditText7.Value = a.docEntry;
            EditText9.Value = a.insID;

            dataForMatrixes = AdoNetQueries.whereFormIsOpenMatrix0(a.insID);
            //this.oForm = this.UIApp.Forms.ActiveForm;
        }
Beispiel #3
0
        public static dataFromOINS GetEqCard(string id)
        {
            dataFromOINS dataOINS = new dataFromOINS();

            //List<dataFromOINS> serviceCallsArr = new List<dataFromOINS>();
            using (HanaCommand command = new HanaCommand()
            {
                Connection = connection
            })
            {
                command.CommandText  = @"select * from ""OINS""";
                command.CommandText += string.Format(@"where ""insID""='{0}'", id);

                connection.Open();

                using (HanaDataAdapter da = new HanaDataAdapter(command.CommandText, connection))
                {
                    using (DataTable dt = new DataTable())
                    {
                        da.Fill(dt);
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            dataOINS.customer = dt.Rows[i]["customer"].ToString();
                            dataOINS.itemCode = dt.Rows[i]["itemCode"].ToString();

                            dataOINS.internalSN = dt.Rows[i]["internalSN"].ToString();
                            dataOINS.custmrName = dt.Rows[i]["custmrName"].ToString();
                            dataOINS.itemName   = dt.Rows[i]["itemName"].ToString();
                            dataOINS.createDate = dt.Rows[i]["createDate"].ToString();

                            dataOINS.docEntry = dt.Rows[i]["U_DocEntry"].ToString();
                            dataOINS.insID    = dt.Rows[i]["insID"].ToString();
                        }
                    }
                }

                connection.Close();

                return(dataOINS);
            }
        }