예제 #1
0
        private static bool CheckData(Company obj, string newDB)
        {
            string q = "USE " + newDB + "; ";

            q += "SELECT * FROM " + COMPANY.COMPANY_TBL + " WHERE " + COMPANY.COMPANY_ID + " = '" + company_id + "'; ";

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    obj.Company_id   = redr[COMPANY.COMPANY_ID].ToString();
                    obj.Company_name = redr[COMPANY.COMPANY_NAME].ToString();
                    //obj.Display_name = redr[COMPANY.DISPLAY_NAME].ToString();
                    obj.City_id    = CCity_exten.GetId_Name(ChangeCase.UpperFirst(obj.City_id));
                    obj.State_id   = CState_exten.GetId_Name(ChangeCase.UpperFirst(obj.State_id));
                    obj.Country_id = CCountry_exten.GetId_Name(obj.Country_id.ToUpper());
                    obj.Pincode_id = CPincode_exten.GetId_Name(obj.Pincode_id.Replace(" ", string.Empty));

                    CCompany.Update(obj, new DAL());

                    return(true);
                }
                return(false);
            }
        }
예제 #2
0
        static internal string TextBoxToString(string value, bool trimText = true, ChangeCase changeCase = ChangeCase.None)
        {
            if (trimText)
            {
                value = value.Trim();
            }
            if (value.Length == 0)
            {
                return(null);
            }
            else
            {
                switch (changeCase)
                {
                case ChangeCase.None:
                    return(value);

                case ChangeCase.Lower:
                    return(value.ToLower());

                case ChangeCase.Upper:
                    return(value.ToUpper());

                case ChangeCase.TitleCase:
                    TextInfo textInfo = new CultureInfo(Application.CurrentCulture.Name, false).TextInfo;
                    return(textInfo.ToTitleCase(value));

                default:
                    return(value);
                }
            }
        }
예제 #3
0
 private static void InsertData(Ordertype obj, string newDB)
 {
     if (CheckData(obj, newDB) == false)
     {
         obj.Ordertype_name = ChangeCase.UpperFirst(obj.Ordertype_name);
         COrdertype.Insert(obj, new DAL());
     }
     ;
 }
예제 #4
0
 private static void InsertData(Deliveredto obj, string newDB)
 {
     if (CheckData(obj, newDB) == false)
     {
         obj.Deliveredto_name = ChangeCase.UpperFirst(obj.Deliveredto_name);
         CDeliveredto.Insert(obj, new DAL());
     }
     ;
 }
예제 #5
0
파일: Data.cs 프로젝트: whistyun/MultiRept
 public static ExtendReplaceTo Group(int index, ChangeCase change)
 {
     return(new ExtendReplaceTo()
     {
         Type = ReplaceToType.GroupIndex,
         Index = index,
         Change = change
     });
 }
예제 #6
0
파일: Data.cs 프로젝트: whistyun/MultiRept
 public static ExtendReplaceTo Group(string label, ChangeCase change)
 {
     return(new ExtendReplaceTo()
     {
         Type = ReplaceToType.GroupLabel,
         Label = label,
         Change = change
     });
 }
예제 #7
0
 private static void InsertData(Month obj, string newDB)
 {
     if (CheckData(obj, newDB) == false)
     {
         obj.Month_name = ChangeCase.UpperFirst(obj.Month_name);
         CMonth.Insert(obj, new DAL());
     }
     ;
 }
예제 #8
0
 private static void InsertData(City obj, string newDB)
 {
     if (CheckData(obj, newDB) == false)
     {
         obj.City_name = ChangeCase.UpperFirst(obj.City_name);
         CCity.Insert(obj, new DAL());
     }
     ;
 }
예제 #9
0
 private static void InsertData(Transport obj, string newDB)
 {
     if (CheckData(obj, newDB) == false)
     {
         obj.Transport_name = ChangeCase.UpperFirst(obj.Transport_name);
         CTransport.Insert(obj, new DAL());
     }
     ;
 }
예제 #10
0
        private City CollectData()
        {
            City fobj = new City()
            {
                City_id   = vId,
                City_name = ChangeCase.UpperFirst(txt_city_name.Text),
                Active_id = Core.Stative,
                Notes     = txt_notes.Text,
                User_id   = Current.User
            };

            return(fobj);
        }
예제 #11
0
 private static void InsertData(Party obj, string newDB)
 {
     if (CheckData(obj, newDB) == false)
     {
         obj.Party_name = obj.Party_name.ToUpper();
         obj.City_id    = CCity_exten.GetId_Name(ChangeCase.UpperFirst(obj.City_id));
         obj.State_id   = CState_exten.GetId_Name(ChangeCase.UpperFirst(obj.State_id));
         obj.Country_id = CCountry_exten.GetId_Name(obj.Country_id.ToUpper());
         obj.Pincode_id = CPincode_exten.GetId_Name(obj.Pincode_id.Replace(" ", string.Empty));
         CParty.Insert(obj, new DAL());
     }
     ;
 }
예제 #12
0
        private Deliveredto CollectData()
        {
            Deliveredto fobj = new Deliveredto()
            {
                Deliveredto_id   = vId,
                Deliveredto_name = ChangeCase.UpperFirst(txt_deliveredto_name.Text),
                Active_id        = Core.Stative,
                Notes            = txt_notes.Text,
                User_id          = Current.User
            };

            return(fobj);
        }
        private void buttonChange_Click(object sender, RoutedEventArgs e)
        {
            foreach (RadioButton rb in this.radioButtonPanel.Children)
            {
                if (rb.IsChecked.Value)
                {
                    selectedCase = rb.Tag.ToString();
                    break;
                }
            }

            ChangeCase?.Invoke(this, e);
        }
예제 #14
0
        private Transport CollectData()
        {
            Transport fobj = new Transport()
            {
                Transport_id   = vId,
                Transport_name = ChangeCase.UpperFirst(txt_transport_name.Text),
                Active_id      = Core.Stative,
                Notes          = txt_notes.Text,
                User_id        = Current.User
            };

            return(fobj);
        }
예제 #15
0
        private Ordertype CollectData()
        {
            Ordertype fobj = new Ordertype()
            {
                Ordertype_id   = vId,
                Ordertype_name = ChangeCase.UpperFirst(txt_ordertype_name.Text),
                Active_id      = Core.Stative,
                Notes          = txt_notes.Text,
                User_id        = Current.User
            };

            return(fobj);
        }
예제 #16
0
        private State CollectData()
        {
            State fobj = new State()
            {
                State_id   = vId,
                State_name = ChangeCase.UpperFirst(txt_state_name.Text),
                State_code = txt_state_code.Text,
                Active_id  = Core.Stative,
                Notes      = txt_notes.Text,
                User_id    = Current.User
            };

            return(fobj);
        }
예제 #17
0
        private Party CollectData()
        {
            Party fobj = new Party()
            {
                Party_id        = vId,
                Party_name      = ChangeCase.ToUpper(txt_party_name.Text),
                Contacttype_id  = CContacttype_exten.GetId_Name(txt_contacttype_id.Text),
                Contact_person  = ChangeCase.UpperFirst(txt_contact_person.Text),
                Street_1        = txt_street1.Text,
                Street_2        = txt_street2.Text,
                City_id         = CCity_exten.GetId_Name(txt_city_id.Text),
                State_id        = CState_exten.GetId_Name(txt_state_id.Text),
                Country_id      = CCountry_exten.GetId_Name(txt_country_id.Text),
                Pincode_id      = CPincode_exten.GetId_Name(txt_pincode_id.Text),
                Phone           = txt_phone.Text,
                Cell            = txt_cell.Text,
                Email           = txt_email.Text,
                Website         = txt_website.Text,
                Gstin           = ChangeCase.ToUpper(txt_gst.Text),
                Pan             = txt_pan.Text,
                Opening_balance = ConvertTO.Decimal(txt_opening_balance.Text),
                Credit_days     = ConvertTO.Decimal(txt_credit_days.Text),
                Active_id       = Core.Stative,
                Notes           = txt_notes.Text,
                User_id         = Current.User
            };

            if ((fobj.Contacttype_id == null) || (fobj.Contacttype_id == ""))
            {
                fobj.Contacttype_id = "1";
            }
            if ((fobj.City_id == null) || (fobj.City_id == ""))
            {
                fobj.City_id = "1";
            }
            if ((fobj.State_id == null) || (fobj.State_id == ""))
            {
                fobj.State_id = "1";
            }
            if ((fobj.Country_id == null) || (fobj.Country_id == ""))
            {
                fobj.Country_id = "1";
            }
            if ((fobj.Pincode_id == null) || (fobj.Pincode_id == ""))
            {
                fobj.Pincode_id = "1";
            }

            return(fobj);
        }
예제 #18
0
        private Month CollectData()
        {
            Month fobj = new Month()
            {
                Month_id     = vId,
                Month_name   = obj.Month_name = ChangeCase.UpperFirst(txt_month_name.Text).ToUpper(),
                Month_starts = txt_month_starts.Text,
                Month_ends   = txt_month_ends.Text,
                Active_id    = Core.Stative,
                Notes        = txt_notes.Text,
                User_id      = Current.User
            };

            return(fobj);
        }
예제 #19
0
파일: Helpers.cs 프로젝트: Gemkin/CrossBase
        public static string ChangeFirstChar(this string s, ChangeCase changeCase)
        {
            if (string.IsNullOrEmpty(s))
                return s;

            var first = string.Empty + s[0];
            switch (changeCase)
            {
                case ChangeCase.ToLower:
                    first = first.ToLower();
                    break;
                case ChangeCase.ToUpper:
                    first = first.ToUpper();
                    break;
            }

            return s.Length == 1 ? first : first + s.Substring(1);
        }
예제 #20
0
        private static bool CheckData(Deliveredto obj, string newDB)
        {
            string q = "USE " + newDB + "; ";

            q += "SELECT * FROM " + DELIVEREDTO.DELIVEREDTO_TBL + " WHERE " + DELIVEREDTO.DELIVEREDTO_NAME + " = '" + obj.Deliveredto_name + "'; ";

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    obj.Deliveredto_id   = redr[DELIVEREDTO.DELIVEREDTO_ID].ToString();
                    obj.Deliveredto_name = ChangeCase.UpperFirst(obj.Deliveredto_name);
                    CDeliveredto.Update(obj, new DAL());

                    return(true);
                }
                return(false);
            }
        }
예제 #21
0
        private static bool CheckData(City obj, string newDB)
        {
            string q = "USE " + newDB + "; ";

            q += "SELECT * FROM " + CITY.CITY_TBL + " WHERE " + CITY.CITY_NAME + " = '" + obj.City_name + "'; ";

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    obj.City_id   = redr[CITY.CITY_ID].ToString();
                    obj.City_name = ChangeCase.UpperFirst(obj.City_name);
                    CCity.Update(obj, new DAL());

                    return(true);
                }
                return(false);
            }
        }
예제 #22
0
        private static bool CheckData(Transport obj, string newDB)
        {
            string q = "USE " + newDB + "; ";

            q += "SELECT * FROM " + TRANSPORT.TRANSPORT_TBL + " WHERE " + TRANSPORT.TRANSPORT_NAME + " = '" + obj.Transport_name + "'; ";

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    obj.Transport_id   = redr[TRANSPORT.TRANSPORT_ID].ToString();
                    obj.Transport_name = ChangeCase.UpperFirst(obj.Transport_name);
                    CTransport.Update(obj, new DAL());

                    return(true);
                }
                return(false);
            }
        }
예제 #23
0
        private static bool CheckData(Ordertype obj, string newDB)
        {
            string q = "USE " + newDB + "; ";

            q += "SELECT * FROM " + ORDERTYPE.ORDERTYPE_TBL + " WHERE " + ORDERTYPE.ORDERTYPE_NAME + " = '" + obj.Ordertype_name + "'; ";

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    obj.Ordertype_id   = redr[ORDERTYPE.ORDERTYPE_ID].ToString();
                    obj.Ordertype_name = ChangeCase.UpperFirst(obj.Ordertype_name);
                    COrdertype.Update(obj, new DAL());

                    return(true);
                }
                return(false);
            }
        }
예제 #24
0
        private static bool CheckData(Party obj, string newDB)
        {
            string q = "USE " + newDB + "; ";

            q += "SELECT * FROM " + PARTY.PARTY_TBL + " WHERE " + PARTY.PARTY_NAME + " = '" + obj.Party_name + "'; ";

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    obj.Party_id   = redr[PARTY.PARTY_ID].ToString();
                    obj.Party_name = obj.Party_name.ToUpper();
                    obj.City_id    = CCity_exten.GetId_Name(ChangeCase.UpperFirst(obj.City_id));
                    obj.State_id   = CState_exten.GetId_Name(ChangeCase.UpperFirst(obj.State_id));
                    obj.Country_id = CCountry_exten.GetId_Name(obj.Country_id.ToUpper());
                    obj.Pincode_id = CPincode_exten.GetId_Name(obj.Pincode_id.Replace(" ", string.Empty));

                    CParty.Update(obj, new DAL());

                    return(true);
                }
                return(false);
            }
        }
예제 #25
0
        private static string XCreate(BillTable obj)
        {
            List <SFields> list = obj.SFields;

            string vtablesname = obj.STables.Stables_name;

            string vnamespaces = obj.STables.Namespaces_id;

            string TABLENAME = vtablesname.ToUpper();

            string TRIM_TBL = vtablesname.Remove(vtablesname.Length - 4);

            string CAPITAL    = cCultureInfo.toUpperCase(TRIM_TBL);
            string SMALL      = cCultureInfo.toLowerCase(TRIM_TBL);
            string UPPERFIRST = ChangeCase.UpperFirst(SMALL);
            string ___result  = "";

            //string xDAL = "DAL";

            #endregion []

            #region [Conclusion]

            ___result += "// " + CVersion_exten.Get_Current_Version() + "\r\n";
            ___result += "// Auto Generated\r\n";
            ___result += "// last update : " + DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss tt") + "\r\n";
            ___result += "\r\n";

            #endregion [Conclusion]

            #region [using]

            ___result += "using System;\r\n";
            //___result += "using System.Drawing;\r\n";
            ___result += "using System.Windows.Forms;\r\n";
            ___result += "using CXLIB;\r\n";
            ___result += "using CXCORE;\r\n";
            ___result += "\r\n";

            #endregion [using]

            #region [namespace]

            ___result += "namespace " + vnamespaces + "\r\n";
            ___result += "{\r\n";
            ___result += "    public partial class L" + UPPERFIRST + " : CxControl\r\n";
            ___result += "    {\r\n";

            #endregion [namespace]

            #region [Grid Action]

            ___result += "            #region[Grid Action]\r\n";
            ___result += "\r\n";
            ___result += "            void Listgrid_RowAction(object sender, EventArgs e)\r\n";
            ___result += "            {\r\n";
            ___result += "             if (listgrid.SelectedRow == null)\r\n";
            ___result += "             {\r\n";
            ___result += "                 return;\r\n";
            ___result += "             }\r\n";
            ___result += "             if (f" + SMALL + " == null)\r\n";
            ___result += "             {\r\n";
            ___result += "                 f" + SMALL + " = new F" + UPPERFIRST + "();\r\n";
            ___result += "             }\r\n";
            ___result += "             BuildForm();\r\n";
            ___result += "             string pkValue = GetSelectedPkValue();\r\n";
            ___result += "             if (pkValue != null)\r\n";
            ___result += "             {\r\n";
            ___result += "                 f" + SMALL + ".SetAction(BtnEvent.Open, pkValue);\r\n";
            ___result += "             }\r\n";
            ___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         #endregion[Grid Action]\r\n";
            ___result += "\r\n";

            #endregion [Grid Action]

            #region [Build Form]

            ___result += "         #region[Build Form]\r\n";
            ___result += "\r\n";
            ___result += "         private void BuildForm()\r\n";
            ___result += "         {\r\n";
            ___result += "             if (f" + SMALL + " == null)\r\n";
            ___result += "             {\r\n";
            ___result += "                 f" + SMALL + " = new F" + UPPERFIRST + "();\r\n";
            ___result += "             }\r\n";
            ___result += "             f" + SMALL + ".F" + UPPERFIRST + "_NeedToRefresh += V" + UPPERFIRST + "_NeedToRefresh;\r\n";
            ___result += "             Parent.Controls.Add(f" + SMALL + ");\r\n";
            ___result += "             f" + SMALL + ".Dock = DockStyle.Fill;\r\n";
            ___result += "             f" + SMALL + ".Show();\r\n";
            ___result += "             f" + SMALL + ".BringToFront();\r\n";
            ___result += "\r\n";
            ___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         #endregion[Build Form]\r\n";
            ___result += "\r\n";

            #endregion [Build Form]

            #region [Radio btn event]

            ___result += "       #region[Radio btn event]\r\n";
            ___result += "\r\n";
            ___result += "       private void Rdo_unrefer_CheckedChanged(object sender, EventArgs e)\r\n";
            ___result += "       {\r\n";
            ___result += "            if (rdo_unrefer.Checked == true)\r\n";
            ___result += "            {\r\n";
            ___result += "                List_Option(ListOption.unrefer);\r\n";
            ___result += "            }\r\n";
            ___result += "       }\r\n";
            ___result += "\r\n";
            ___result += "       private void Rdo_refer_CheckedChanged(object sender, EventArgs e)\r\n";
            ___result += "       {\r\n";
            ___result += "            if (rdo_refer.Checked == true)\r\n";
            ___result += "            {\r\n";
            ___result += "                List_Option(ListOption.refer);\r\n";
            ___result += "            }\r\n";
            ___result += "       }\r\n";
            ___result += "\r\n";
            ___result += "       private void Rdo_showall_CheckedChanged(object sender, EventArgs e)\r\n";
            ___result += "       {\r\n";
            ___result += "            if (rdo_showall.Checked == true)\r\n";
            ___result += "            {\r\n";
            ___result += "                List_Option(ListOption.showall);\r\n";
            ___result += "            }\r\n";
            ___result += "       }\r\n";
            ___result += "\r\n";
            ___result += "       private void Rdo_notactive_CheckedChanged(object sender, EventArgs e)\r\n";
            ___result += "       {\r\n";
            ___result += "            if (rdo_notactive.Checked == true)\r\n";
            ___result += "            {\r\n";
            ___result += "                List_Option(ListOption.notactive);\r\n";
            ___result += "            }\r\n";
            ___result += "       }\r\n";
            ___result += "\r\n";
            ___result += "       #endregion[Radio btn event]\r\n";
            ___result += "\r\n";
            #endregion [Radio btn event]

            #region [Btn Event]

            ___result += "         #region[Btn Event]\r\n";
            ___result += "\r\n";
            ___result += "        private void Btn_refresh_Click(object sender, EventArgs e)\r\n";
            ___result += "        {\r\n";
            ___result += "            List_Option(ListOption.active);\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        private void Btn_new_Click(object sender, EventArgs e)\r\n";
            ___result += "        {\r\n";
            ___result += "            BuildForm();\r\n";
            ___result += "                f" + SMALL + ".SetAction(BtnEvent.New, null);\r\n";
            ___result += "                f" + SMALL + ".SetFocus();\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        private void Btn_edit_Click(object sender, EventArgs e)\r\n";
            ___result += "        {\r\n";
            ___result += "            string pkValue = GetSelectedPkValue();\r\n";
            //___result += "            if (CPo_exten.LockStatus(pkValue) == false)\r\n";
            //___result += "            {\r\n";
            ___result += "                BuildForm();\r\n";
            ___result += "                if (pkValue != null)\r\n";
            ___result += "                {\r\n";
            ___result += "                    f" + SMALL + ".SetAction(BtnEvent.Edit, pkValue);\r\n";
            ___result += "                    f" + SMALL + ".SetFocus();\r\n";
            ___result += "                }\r\n";
            //___result += "            }\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        private void Btn_delete_Click(object sender, EventArgs e)\r\n";
            ___result += "        {\r\n";
            ___result += "            string pkValue = GetSelectedPkValue();\r\n";
            //___result += "            if (CPo_exten.LockStatus(pkValue) == false)\r\n";
            //___result += "            {\r\n";
            ___result += "                BuildForm();\r\n";
            ___result += "                if (pkValue != null)\r\n";
            ___result += "                {\r\n";
            ___result += "                    f" + SMALL + ".SetAction(BtnEvent.Delete, pkValue);\r\n";
            ___result += "                    f" + SMALL + ".SetFocus();\r\n";
            ___result += "                }\r\n";
            //___result += "            }\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        private void Btn_print_Click(object sender, EventArgs e)\r\n";
            ___result += "        {\r\n";
            ___result += "            BuildForm();\r\n";
            ___result += "            string pkValue = GetSelectedPkValue();\r\n";
            ___result += "            if (pkValue != null)\r\n";
            ___result += "            {\r\n";
            ___result += "                f" + SMALL + ".SetAction(BtnEvent.Print, pkValue);\r\n";
            ___result += "                f" + SMALL + ".SetFocus();\r\n";
            ___result += "            }\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        private void Btn_close_Click(object sender, EventArgs e)\r\n";
            ___result += "        {\r\n";
            ___result += "            Hide();\r\n";
            ___result += "            RaiseEvent_NeedToRefresh();\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        private void Btn_search_Click(object sender, EventArgs e)\r\n";
            ___result += "        {\r\n";
            ___result += "            List_Option(ListOption.Search);\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "         #endregion[Btn Event]\r\n";
            ___result += "\r\n";

            #endregion [Btn Event]

            #region [text change event]

            ___result += "         #region[text change event]\r\n";
            ___result += "\r\n";
            ___result += "        private void Txt_datePicker_TextChanged(object sender, EventArgs e)\r\n";
            ___result += "        {\r\n";
            ___result += "            txt_date.Text = txt_datePicker.Text;\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        private void Txt_TodatePicker_TextChanged(object sender, EventArgs e)\r\n";
            ___result += "        {\r\n";
            ___result += "            txt_Todate.Text = txt_TodatePicker.Text;\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "         #endregion[text change event]\r\n";
            ___result += "\r\n";

            #endregion [text change event]

            #region [Enter Event]
            ___result += "         #region[Enter Event]\r\n";
            ___result += "\r\n";
            ___result += "         private void Txt_no_Enter(object sender, EventArgs e)\r\n";
            ___result += "         {\r\n";
            ___result += "             Change_infocus();\r\n";
            ___result += "             lbl_no.BackColor = XTheme.lbl_EnterBackColor;\r\n";
            ___result += "             lbl_no.BorderColor = XTheme.lbl_EnterBorderColor;\r\n";
            ___result += "             lbl_no.ForeColor = XTheme.lbl_EnterForeColor;\r\n";
            ___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         private void Txt_date_Enter(object sender, EventArgs e)\r\n";
            ___result += "         {\r\n";
            ___result += "             lbl_date.BackColor = XTheme.lbl_EnterBackColor;\r\n";
            ___result += "             lbl_date.BorderColor = XTheme.lbl_EnterBorderColor;\r\n";
            ___result += "             lbl_date.ForeColor = XTheme.lbl_EnterForeColor;\r\n";
            ___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         private void Txt_party_Enter(object sender, EventArgs e)\r\n";
            ___result += "         {\r\n";
            ___result += "             lbl_party.BackColor = XTheme.lbl_EnterBackColor;\r\n";
            ___result += "             lbl_party.BorderColor = XTheme.lbl_EnterBorderColor;\r\n";
            ___result += "             lbl_party.ForeColor = XTheme.lbl_EnterForeColor;\r\n";
            ___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         private void Change_infocus()\r\n";
            ___result += "         {\r\n";
            ___result += "\r\n";
            ___result += "             lbl_no.BackColor = XTheme.lbl_BackColor;\r\n";
            ___result += "             lbl_no.BorderColor = XTheme.lbl_BorderColor;\r\n";
            ___result += "             lbl_no.ForeColor = XTheme.lbl_ForeColor;\r\n";
            ___result += "\r\n";
            ___result += "             lbl_date.BackColor = XTheme.lbl_BackColor;\r\n";
            ___result += "             lbl_date.BorderColor = XTheme.lbl_BorderColor;\r\n";
            ___result += "             lbl_date.ForeColor = XTheme.lbl_ForeColor;\r\n";
            ___result += "\r\n";
            ___result += "             lbl_party.BackColor = XTheme.lbl_BackColor;\r\n";
            ___result += "             lbl_party.BorderColor = XTheme.lbl_BorderColor;\r\n";
            ___result += "             lbl_party.ForeColor = XTheme.lbl_ForeColor;\r\n";
            ___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         #endregion[Enter Event]\r\n";
            ___result += "\r\n";

            #endregion [Enter Event]

            #region [lookup]

            ___result += "         #region[No lookup]\r\n";
            ___result += "\r\n";
            ___result += "         public void No_lookup()\r\n";
            ___result += "         {\r\n";
            ___result += "             txt_no.LookupColNames = new string[] { " + CAPITAL + "." + CAPITAL + "_NO };\r\n";
            ___result += "             txt_no.LookupUpdate += Txt_no_LookupUpdate;\r\n";
            ___result += "         }\r\n";
            ___result += "         void Txt_no_LookupUpdate(object sender, EventArgs e)\r\n";
            ___result += "         {\r\n";
            ___result += "             txt_no.LookupList = C" + UPPERFIRST + "_exten.LookupNo();\r\n";
            ___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         #endregion[No lookup]\r\n";
            ___result += "\r\n";
            ___result += "         #region[Party lookup]\r\n";
            ___result += "\r\n";
            ___result += "         public void Party_lookup()\r\n";
            ___result += "         {\r\n";
            ___result += "             txt_party.LookupColNames = new string[] { PARTY.PARTY_NAME };\r\n";
            ___result += "             txt_party.LookupUpdate += Txt_party_LookupUpdate;\r\n";
            ___result += "         }\r\n";
            ___result += "         void Txt_party_LookupUpdate(object sender, EventArgs e)\r\n";
            ___result += "         {\r\n";
            ___result += "             txt_party.LookupList = CParty_exten.GetforLookup(new DAL());\r\n";
            ___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         #endregion[Party lookup]\r\n";
            ___result += "\r\n";

            #endregion [lookup]

            #region [Get selected pk value]

            ___result += "         #region[Get selected pk value]\r\n";
            ___result += "\r\n";
            ___result += "         private string GetSelectedPkValue()\r\n";
            ___result += "         {\r\n";
            ___result += "             DataGridViewRow vSelRow = null;\r\n";
            ___result += "             if (listgrid.SelectedRows != null && listgrid.SelectedRows.Count != 0)\r\n";
            ___result += "             {\r\n";
            ___result += "                 vSelRow = listgrid.SelectedRows[0];\r\n";
            ___result += "             }\r\n";
            ___result += "\r\n";
            ___result += "             string selPkValue = null;\r\n";
            ___result += "             if (vSelRow != null)\r\n";
            ___result += "             {\r\n";
            ___result += "                 selPkValue = vSelRow.Cells[" + CAPITAL + "." + CAPITAL + "_ID].Value.ToString();\r\n";
            ___result += "             }\r\n";
            ___result += "             return selPkValue;\r\n";
            ___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         #endregion[Get selected pk value]\r\n";
            ___result += "\r\n";

            #endregion [Get selected pk value]

            #region [RaiseEvent]

            ___result += "         #region[RaiseEvent]\r\n";
            ___result += "\r\n";
            ___result += "         void V" + UPPERFIRST + "_NeedToRefresh(object sender, EventArgs e)\r\n";
            ___result += "         {\r\n";
            ___result += "             List_Option(ListOption.active);\r\n";
            ___result += "         }\r\n";

            //___result += "         public event EventHandler L" + UPPERFIRST + "_NeedToRefresh;\r\n";
            //___result += "         public void RaiseEvent_NeedToRefresh()\r\n";
            //___result += "         {\r\n";
            //___result += "             L" + UPPERFIRST + "_NeedToRefresh?.Invoke(this, new EventArgs());\r\n";
            //___result += "         }\r\n";
            ___result += "\r\n";
            ___result += "         #endregion[RaiseEvent]\r\n";
            ___result += "\r\n";

            #endregion [RaiseEvent]

            #region [finally return]

            ___result += "    }//cls\r\n";
            ___result += "}//ns\r\n";
            return(___result);

            #endregion [Finally return]
        }
예제 #26
0
        private static string XCreate(MasterDetails obj)
        {
            List <MasterTablesItems> list = obj.Mastertablesitems;

            string vtablesname = obj.Mastertable.Mastertables_name;

            string vnamespaces = obj.Mastertable.Namespaces_id;

            string TABLENAME = vtablesname.ToUpper();

            string TRIM_TBL = vtablesname.Remove(vtablesname.Length - 4);

            string CAPITAL    = ChangeCase.ToUpper(TRIM_TBL);
            string SMALL      = ChangeCase.ToLower(TRIM_TBL);
            string UPPERFIRST = ChangeCase.UpperFirst(SMALL);

            string ___result = "";

            #endregion []

            #region [Conclusion]

            ___result += "// " + CVersion_exten.Get_Current_Version() + "\r\n";
            ___result += "// Auto Generated\r\n";
            ___result += "// last update : " + DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss tt") + "\r\n";
            ___result += "\r\n";
            #endregion [Conclusion]

            #region [namespace]

            ___result += "namespace " + vnamespaces + "\r\n";
            ___result += "{\r\n";

            #endregion [namespace]

            #region [string Properties]

            ___result += "    #region[Properties]\r\n";
            ___result += "\r\n";
            ___result += "    public class " + UPPERFIRST + "\r\n";
            ___result += "    {\r\n";
            ___result += "        public string " + UPPERFIRST + "_id { get; set; }\r\n";

            for (int r = 0; r < list.Count; r++)
            {
                switch (list[r].Datatype)
                {
                case DATATYPES.INT:
                    ___result += "        public int " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                    break;

                case DATATYPES.DECMIAL_2:
                    ___result += "        public decimal " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                    break;

                case DATATYPES.DECMIAL_3:
                    ___result += "        public decimal " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                    break;

                default:
                    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                    break;
                }
            }
            ___result += "        public string Notes { get; set; }\r\n";
            ___result += "        public string Active_id { get; set; }\r\n";
            ___result += "        public string User_id { get; set; }\r\n";
            ___result += "    }\r\n";
            ___result += "\r\n";
            ___result += "    #endregion[Properties]\r\n";
            ___result += "\r\n";

            #endregion [string Properties]

            #region [string Const class]

            ___result += "    #region[Const]\r\n";
            ___result += "\r\n";
            ___result += "    public static class " + CAPITAL + "\r\n";
            ___result += "    {\r\n";
            ___result += "        public const string " + CAPITAL + "_ID = \"" + CAPITAL + "_ID\";\r\n";
            for (int r = 0; r < list.Count; r++)
            {
                ___result += "        public const string " + list[r].Fieldsname.ToUpper() + " = \"" + list[r].Fieldsname.ToUpper() + "\";\r\n";
            }

            ___result += "        public const string NOTES = \"NOTES\";\r\n";
            ___result += "        public const string ACTIVE_ID = \"ACTIVE_ID\";\r\n";
            ___result += "        public const string USER_ID = \"USER_ID\";\r\n";
            ___result += "\r\n";
            ___result += "        public const string " + TABLENAME.ToUpper() + " = \"" + TABLENAME.ToUpper() + "\";\r\n";
            ___result += "    }\r\n";
            ___result += "\r\n";
            ___result += "    #endregion[Const]\r\n";
            ___result += "\r\n";
            ___result += "}//ns\r\n";

            #endregion [string Const class]

            #region [result]

            return(___result);
        }
예제 #27
0
        private static string XCreate(BillTable obj)
        {
            List <SFieldsItems> list = obj.SFieldsItems;

            string vtablesname = obj.STables.Stables_name;

            string vnamespaces = obj.STables.Namespaces_id;

            //string TABLENAME = vtablesname.ToUpper();

            string TRIM_TBL = vtablesname.Remove(vtablesname.Length - 4);

            string CAPITAL    = cCultureInfo.toUpperCase(TRIM_TBL);
            string SMALL      = cCultureInfo.toLowerCase(TRIM_TBL);
            string UPPERFIRST = ChangeCase.UpperFirst(SMALL);
            string ___result  = "";

            string xDAL = "DAL";

            #endregion []

            #region [Conclusion]

            ___result += "// " + CVersion_exten.Get_Current_Version() + "\r\n";
            ___result += "// Auto Generated\r\n";
            ___result += "// last update : " + DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss tt") + "\r\n";
            ___result += "\r\n";

            #endregion [Conclusion]

            #region [using]

            ___result += "using System.Collections.Generic;\r\n";
            //___result += "using System.Data;\r\n";
            ___result += "using CXLIB;\r\n";
            ___result += "\r\n";

            #endregion [using]

            #region [namespace]

            ___result += "namespace " + vnamespaces + "\r\n";
            ___result += "{\r\n";
            ___result += "    public class C" + UPPERFIRST + "items \r\n";
            ___result += "    {\r\n";

            #endregion [namespace]

            #region [Get New]

            ___result += "\r\n";
            ___result += "        #region[Get New]\r\n";
            ___result += "\r\n";
            ___result += "        public static List<" + UPPERFIRST + "items> GetNew\r\n";
            ___result += "        {\r\n";
            ___result += "            get\r\n";
            ___result += "            {\r\n";
            ___result += "            List<" + UPPERFIRST + "items> list = new List<" + UPPERFIRST + "items>();\r\n";
            ___result += "\r\n";
            ___result += "                " + UPPERFIRST + "items obj = new " + UPPERFIRST + "items()\r\n";
            ___result += "                {\r\n";
            ___result += "                    " + UPPERFIRST + "items_id = string.Empty,\r\n";

            for (int r = 0; r < list.Count; r++)
            {
                switch (list[r].Datatype)

                {
                //case DATATYPES.VARCHAR_500:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;

                //case DATATYPES.VARCHAR_300:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;

                //case DATATYPES.VARCHAR_200:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;

                //case DATATYPES.VARCHAR_100:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;

                //case DATATYPES.UNIQUE_500:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;

                //case DATATYPES.INT:
                //    ___result += "        public int " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;

                //case DATATYPES.FORIEGN:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;


                //case DATATYPES.DATE:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;

                //case DATATYPES.DATETIME:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;

                //case DATATYPES.ENUM_Y_N:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;
                //case DATATYPES.SMALLINT:
                //    ___result += "        public string " + ChangeCase.UpperFirst(list[r].Fieldsname.ToLower()) + " { get; set; }\r\n";
                //    break;

                case DATATYPES.BOOLX:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " =  false,\r\n";
                    break;

                case DATATYPES.FALSEX:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " =  false,\r\n";
                    break;

                case DATATYPES.TRUEX:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " =  false,\r\n";
                    break;

                case DATATYPES.DECMIAL_3:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " =  decimal.Zero,\r\n";
                    break;

                case DATATYPES.DECMIAL_2:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " =  decimal.Zero,\r\n";
                    break;

                case DATATYPES.DOUBLE:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " = 0,\r\n";
                    break;


                default:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " = string.Empty,\r\n";
                    break;
                }
            }
            ___result += "                };\r\n";
            ___result += "                list.Add(obj);\r\n";
            ___result += "                return list;\r\n";
            ___result += "            }\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        #endregion[Get New]\r\n";
            ___result += "\r\n";

            #endregion [Get New]

            #region [Attach params ]

            ___result += "        #region[Attach params]\r\n";
            ___result += "        \r\n";
            ___result += "        private static string AttachParams(string q, " + UPPERFIRST + "items v)\r\n";
            ___result += "        {\r\n";
            //___result += "            q = q.Replace(\"@\" + " + CAPITAL + "ITEMS." + CAPITAL + "ITEMS_ID + \"@\", \"\" + ConvertTO.SqlString(v." + UPPERFIRST + "items_id) + \"\");\r\n";

            for (int r = 0; r <= list.Count - 1; r++)
            {
                switch (list[r].Datatype)
                {
                case DATATYPES.DATE:
                    ___result += "            q = q.Replace(\"@\" + " + CAPITAL + "ITEMS." + list[r].Fieldsname.ToUpper() + " + \"@\", \"\" + ConvertTO.SqlDate(v." + list[r].Fieldsname.UpperFirst() + ") + \"\");\r\n";
                    break;

                case DATATYPES.DATETIME:
                    ___result += "            q = q.Replace(\"@\" + " + CAPITAL + "ITEMS." + list[r].Fieldsname.ToUpper() + " + \"@\", \"\" + ConvertTO.SqlDateTime(v." + list[r].Fieldsname.UpperFirst() + ") + \"\");\r\n";
                    break;

                //case DATATYPES.INT:
                //    sqlstr = "SqlInt";
                //    break;

                case DATATYPES.DECMIAL_2:
                    ___result += "            q = q.Replace(\"@\" + " + CAPITAL + "ITEMS." + list[r].Fieldsname.ToUpper() + " + \"@\", \"\" + ConvertTO.SqlDecimal(v." + list[r].Fieldsname.UpperFirst() + ") + \"\");\r\n";
                    break;

                case DATATYPES.DECMIAL_3:
                    ___result += "            q = q.Replace(\"@\" + " + CAPITAL + "ITEMS." + list[r].Fieldsname.ToUpper() + " + \"@\", \"\" + ConvertTO.SqlDecimal(v." + list[r].Fieldsname.UpperFirst() + ") + \"\");\r\n";
                    break;

                default:
                    ___result += "            q = q.Replace(\"@\" + " + CAPITAL + "ITEMS." + list[r].Fieldsname.ToUpper() + " + \"@\", \"\" + ConvertTO.SqlString(v." + list[r].Fieldsname.UpperFirst() + ") + \"\");\r\n";
                    break;
                }
            }
            ___result += "            return q;\r\n";
            ___result += "        }\r\n";
            ___result += "        #endregion[Attach params]\r\n";
            ___result += "        \r\n";

            #endregion [Attach params ]

            #region [Insert]

            ___result += "        #region[Insert]\r\n";
            ___result += "        \r\n";
            ___result += "        public static void Insert(List<" + UPPERFIRST + "items> list, " + xDAL + " dalsession)\r\n";
            ___result += "        {\r\n";
            ___result += "            for (int i = 0; i < list.Count; i++)\r\n";
            ___result += "            {\r\n";
            ___result += "                " + UPPERFIRST + "items obj = new " + UPPERFIRST + "items()\r\n";
            ___result += "                {\r\n";
            //___result += "                " + UPPERFIRST + "items_id = list[i]." + UPPERFIRST + "items_id,\r\n";

            for (int r = 0; r < list.Count - 1; r++)
            {
                ___result += "                    " + list[r].Fieldsname.UpperFirst() + " = list[i]." + list[r].Fieldsname.UpperFirst() + ",\r\n";
            }
            //remove , from last line
            for (int r = list.Count - 1; r < list.Count; r++)
            {
                ___result += "                    " + list[r].Fieldsname.UpperFirst() + " = list[i]." + list[r].Fieldsname.UpperFirst() + "\r\n";
            }

            ___result += "                };\r\n";
            ___result += "                InsertSub(obj, dalsession);\r\n";
            ___result += "            }\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        #endregion[Insert]\r\n";
            ___result += "\r\n";

            #endregion [Insert]

            #region [Insert Sub]

            ___result += "        #region[InsertSub]\r\n";
            ___result += "        \r\n";
            ___result += "        public static void InsertSub(" + UPPERFIRST + "items v, " + xDAL + " dalsession)\r\n";
            ___result += "        {\r\n";
            ___result += "                string q = \" INSERT INTO \" + " + CAPITAL + "ITEMS." + CAPITAL + "ITEMS_TBL + \" ( \";\r\n";

            ___result += "                q += \" \" + " + CAPITAL + "ITEMS." + list[0].Fieldsname.ToUpper() + " + \" \\r\\n \";\r\n";
            for (int r = 1; r < list.Count; r++)
            {
                ___result += "                q += \",\" + " + CAPITAL + "ITEMS." + list[r].Fieldsname.ToUpper() + " + \" \\r\\n \";\r\n";
            }
            ___result += "                q += \" ) VALUES ( \";\r\n";
            ___result += "                q += \"  @\"+ " + CAPITAL + "ITEMS." + list[0].Fieldsname.ToUpper() + " + \"@ \\r\\n \";\r\n";

            for (int r = 1; r < list.Count; r++)
            {
                ___result += "                q += \", @\"+ " + CAPITAL + "ITEMS." + list[r].Fieldsname.ToUpper() + " + \"@ \\r\\n \";\r\n";
            }
            ___result += "                q += \" ) \\r\\n \";\r\n";
            ___result += "                q = AttachParams(q, v);\r\n";
            ___result += "                dalsession.Execute(q);\r\n";
            ___result += "        }\r\n";
            ___result += "        #endregion[Insert]\r\n";
            ___result += "        \r\n";

            #endregion [InsertSub]

            #region [Build delete query]

            ___result += "        #region[Delete]\r\n";
            ___result += "        \r\n";
            ___result += "        public static void Delete(string fkid , " + xDAL + " dalsession)\r\n";;
            ___result += "        {\r\n";
            ___result += "                dalsession.Execute(\"DELETE FROM  \" + " + CAPITAL + "ITEMS." + CAPITAL + "ITEMS_TBL+ \" WHERE \" + " + CAPITAL + "ITEMS." + CAPITAL + "_ID + \" =  \" + fkid +\";\");\r\n";
            ___result += "        }\r\n";
            ___result += "        #endregion[Delete]\r\n";
            ___result += "        \r\n";

            #endregion [delete query]

            #region [result]
            ___result += "    }//cls\r\n";
            ___result += "}//ns\r\n";
            return(___result);

            #endregion [result]
        }
예제 #28
0
 public SelectionChangeCaseEvent(ChangeCase changeType)
 {
     ChangeType = changeType;
 }
예제 #29
0
        //
        private static string XCreate(BillTable obj)
        {
            List <SFields> list = obj.SFields;

            string vtablesname = obj.STables.Stables_name;

            string vnamespaces = obj.STables.Namespaces_id;

            string TABLENAME = vtablesname.ToUpper();

            string TRIM_TBL = vtablesname.Remove(vtablesname.Length - 4);

            string CAPITAL    = ChangeCase.ToUpper(TRIM_TBL);
            string SMALL      = ChangeCase.ToLower(TRIM_TBL);
            string UPPERFIRST = ChangeCase.UpperFirst(SMALL);

            string ___result = "";

            string xDAL = "SQLITE_DAL";

            //
            #endregion []

            #region [Conclusion]

            ___result += "// " + CVersion_exten.Get_Current_Version() + "\r\n";
            ___result += "// Auto Generated\r\n";
            ___result += "// last update : " + DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss tt") + "\r\n";
            ___result += "\r\n";

            #endregion [Conclusion]

            #region [using]

            //___result += "using System.Collections.Generic;\r\n";
            //___result += "using System.Data;\r\n";
            ___result += "using CXLIB;\r\n";
            ___result += "\r\n";

            #endregion [using]

            #region [namespace]

            ___result += "namespace " + vnamespaces + "\r\n";
            ___result += "{\r\n";
            ___result += "    public class C" + UPPERFIRST + "\r\n";
            ___result += "    {\r\n";

            #endregion [namespace]

            #region [Get New]

            ___result += "\r\n";
            ___result += "        #region[Get New]\r\n";
            ___result += "\r\n";
            ___result += "        public static " + UPPERFIRST + " GetNew\r\n";
            ___result += "        {\r\n";
            ___result += "            get\r\n";
            ___result += "            {\r\n";
            ___result += "                " + UPPERFIRST + " obj = new " + UPPERFIRST + "()\r\n";
            ___result += "                {\r\n";
            ___result += "                    " + UPPERFIRST + "_id = string.Empty,\r\n";

            for (int r = 0; r <= list.Count - 1; r++)
            {
                switch (list[r].Datatype)
                {
                case DATATYPES.INT:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " = 0,\r\n";
                    break;

                case DATATYPES.DECMIAL_2:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " = decimal.Zero,\r\n";
                    break;

                case DATATYPES.DECMIAL_3:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " = decimal.Zero,\r\n";
                    break;

                default:
                    ___result += "                    " + list[r].Fieldsname.UpperFirst() + " = string.Empty,\r\n";
                    break;
                }
            }

            ___result += "                    Notes = string.Empty,\r\n";
            ___result += "                    Active_id = Core.Active,\r\n";
            ___result += "                    User_id = Current.User\r\n";
            ___result += "                };\r\n";
            ___result += "                return obj;\r\n";
            ___result += "            }\r\n";
            ___result += "        }\r\n";
            ___result += "\r\n";
            ___result += "        #endregion[Get New]\r\n";
            ___result += "\r\n";

            #endregion [Get New]

            #region [Attach params ]

            ___result += "        #region[Attach params]\r\n";
            ___result += "\r\n";
            ___result += "        private static string AttachParams(string q, " + UPPERFIRST + " v)\r\n";
            ___result += "        {\r\n";
            ___result += "            q = q.Replace(\"@\" + " + CAPITAL + "." + CAPITAL + "_ID + \"@\", \"\" + ConvertTO.SqlString(v." + UPPERFIRST + "_id) + \"\");\r\n";

            for (int r = 0; r < list.Count; r++)
            {
                string sqlstr = "";

                switch (list[r].Datatype)
                {
                case DATATYPES.DATE:
                    sqlstr = "SqlDate";
                    break;

                case DATATYPES.DATETIME:
                    sqlstr = "SqlDateTime";
                    break;

                case DATATYPES.INT:
                    sqlstr = "SqlInt";
                    break;

                case DATATYPES.DECMIAL_2:
                    sqlstr = "SqlDecimal";
                    break;

                case DATATYPES.DECMIAL_3:
                    sqlstr = "SqlDecimal";
                    break;

                default:
                    sqlstr = "SqlString";
                    break;
                }

                ___result += "            q = q.Replace(\"@\" + " + CAPITAL + "." + list[r].Fieldsname.ToUpper() + " + \"@\", \"\" + ConvertTO." + sqlstr + "(v." + list[r].Fieldsname.UpperFirst() + ") + \"\");\r\n";
            }
            ___result += "            q = q.Replace(\"@\" + " + CAPITAL + ".NOTES + \"@\", \"\" + ConvertTO.SqlString(v.Notes) + \"\");\r\n";
            ___result += "            q = q.Replace(\"@\" + " + CAPITAL + ".ACTIVE_ID + \"@\", \"\" + ConvertTO.SqlString(v.Active_id) + \"\");\r\n";
            ___result += "            q = q.Replace(\"@\" + " + CAPITAL + ".USER_ID + \"@\", \"\" + ConvertTO.SqlString(v.User_id) + \"\");\r\n";
            ___result += "            return q;\r\n";
            ___result += "        }\r\n";
            ___result += "        #endregion[Attach params]\r\n";
            ___result += "\r\n";

            #endregion [Attach params ]

            #region [Insert Query]

            ___result += "        #region[Insert]\r\n";
            ___result += "\r\n";
            ___result += "        public static void Insert(" + UPPERFIRST + " v, " + xDAL + " dalsession)\r\n";
            ___result += "        {\r\n";
            ___result += "                string q = \" INSERT INTO \" + " + CAPITAL + "." + CAPITAL + "_TBL + \" ( \";\r\n";
            ___result += "                q += \" \" + " + CAPITAL + "." + list[0].Fieldsname.ToUpper() + " + \" \\r\\n \";\r\n";

            for (int r = 1; r < list.Count; r++)
            {
                ___result += "                q += \",\" + " + CAPITAL + "." + list[r].Fieldsname.ToUpper() + " + \" \\r\\n \";\r\n";
            }
            ___result += "                q += \",\" + " + CAPITAL + ".NOTES + \" \\r\\n \";\r\n";
            ___result += "                q += \",\" + " + CAPITAL + ".ACTIVE_ID + \" \\r\\n \";\r\n";
            ___result += "                q += \",\" + " + CAPITAL + ".USER_ID + \" \\r\\n \";\r\n";
            ___result += "                q += \" ) VALUES ( \";\r\n";
            ___result += "                q += \"  @\"+ " + CAPITAL + "." + list[0].Fieldsname.ToUpper() + " + \"@ \\r\\n \";\r\n";

            for (int r = 1; r < list.Count; r++)
            {
                ___result += "                q += \", @\"+ " + CAPITAL + "." + list[r].Fieldsname.ToUpper() + " + \"@ \\r\\n \";\r\n";
            }

            ___result += "                q += \", @\"+ " + CAPITAL + ".NOTES + \"@ \\r\\n \";\r\n";
            ___result += "                q += \", @\"+ " + CAPITAL + ".ACTIVE_ID + \"@ \\r\\n \";\r\n";
            ___result += "                q += \", @\"+ " + CAPITAL + ".USER_ID + \"@ \\r\\n \";\r\n";
            ___result += "                q += \" ) \\r\\n \";\r\n";
            ___result += "                q = AttachParams(q, v);\r\n";
            ___result += "                dalsession.Execute(q);\r\n";
            ___result += "        }\r\n";
            ___result += "        #endregion[Insert]\r\n";
            ___result += "\r\n";

            #endregion [Insert Query]

            #region [Update query]

            ___result += "        #region[Update]\r\n";
            ___result += "\r\n";
            ___result += "        public static void Update(" + UPPERFIRST + " v, " + xDAL + " dalsession)\r\n";
            ___result += "        {\r\n";
            ___result += "                string q = \"UPDATE \" + " + CAPITAL + "." + TABLENAME + " + \" SET\";\r\n";

            ___result += "                q += " + "\" \" + " + CAPITAL + "." + list[0].Fieldsname.ToUpper() + " + \" = @\" + " + CAPITAL + "." + list[0].Fieldsname.ToUpper() + " + \"@ \\r\\n \";\r\n";

            for (int r = 1; r < list.Count; r++)
            {
                ___result += "                q += " + "\",\" + " + CAPITAL + "." + list[r].Fieldsname.ToUpper() + " + \" = @\" + " + CAPITAL + "." + list[r].Fieldsname.ToUpper() + " + \"@ \\r\\n \";\r\n";
            }

            ___result += "                q += " + "\",\" + " + CAPITAL + ".NOTES + \" = @\" + " + CAPITAL + ".NOTES + \"@ \\r\\n \";\r\n";
            ___result += "                q += " + "\",\" + " + CAPITAL + ".ACTIVE_ID + \" = @\" + " + CAPITAL + ".ACTIVE_ID + \"@ \\r\\n \";\r\n";
            ___result += "                q += " + "\",\" + " + CAPITAL + ".USER_ID + \" = @\" + " + CAPITAL + ".USER_ID + \"@ \\r\\n \";\r\n";
            ___result += "                q += \"  WHERE \" + " + CAPITAL + "." + CAPITAL + "_ID + \" = @\" + " + CAPITAL + "." + CAPITAL + "_ID + \"@ \";\r\n";
            ___result += "                q = AttachParams(q, v);\r\n";
            ___result += "                dalsession.Execute(q);\r\n";
            ___result += "        }\r\n";
            ___result += "        #endregion[Update]\r\n";
            ___result += "\r\n";

            #endregion [Update query]

            #region [Build delete query]

            ___result += "        #region[Delete]\r\n";
            ___result += "\r\n";
            ___result += "        public static void Delete(string pkid , " + xDAL + " dalsession)\r\n";;
            ___result += "        {\r\n";
            ___result += "                dalsession.Execute(\"DELETE FROM  \" + " + CAPITAL + "." + TABLENAME + "+ \" WHERE \" + " + CAPITAL + "." + CAPITAL + "_ID + \" =  \" + pkid +\";\");\r\n";
            ___result += "        }\r\n";
            ___result += "        #endregion[Delete]\r\n";
            ___result += "\r\n";

            #endregion [delete query]

            #region [result]
            ___result += "    }//cls\r\n";
            ___result += "}//ns\r\n";
            return(___result);

            #endregion [result]
        }
예제 #30
0
        private static string XCreate(MasterDetails obj)
        {
            List <MasterTablesItems> list = obj.Mastertablesitems;

            string vtablesname = obj.Mastertable.Mastertables_name;

            string vnamespaces = obj.Mastertable.Namespaces_id;

            string TABLENAME = vtablesname.ToUpper();

            string TRIM_TBL = vtablesname.Remove(vtablesname.Length - 4);

            string CAPITAL    = cCultureInfo.toUpperCase(TRIM_TBL);
            string SMALL      = cCultureInfo.toLowerCase(TRIM_TBL);
            string UPPERFIRST = ChangeCase.UpperFirst(SMALL);
            string ___result  = "";

            //string xDAL = "DAL";

            #endregion []

            #region [Conclusion]

            ___result += "// " + CVersion_exten.Get_Current_Version() + "\r\n";
            ___result += "// Auto Generated\r\n";
            ___result += "// last update : " + DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss tt") + "\r\n";
            ___result += "\r\n";

            #endregion [Conclusion]

            #region [using]

            ___result += "using System; \r\n";
            ___result += "using System.Drawing; \r\n";
            ___result += "using System.Windows.Forms; \r\n";
            ___result += "using CXLIB; \r\n";
            ___result += " \r\n";

            #endregion [using]

            #region [namespace]

            ___result += "namespace " + vnamespaces + " \r\n";
            ___result += "{ \r\n";
            ___result += "    public partial class L" + UPPERFIRST + ": CxControl\r\n";
            ___result += "    { \r\n";

            #endregion [namespace]

            #region []
            ___result += "\r\n";
            ___result += "          private F" + UPPERFIRST + " f" + SMALL + " = null;\r\n";
            ___result += "\r\n";
            ___result += "         public L" + UPPERFIRST + "()\r\n";
            ___result += "         {\r\n";
            ___result += "             InitializeComponent();\r\n";
            ___result += "             Initialize();\r\n";
            ___result += "             InitGrid();\r\n";
            ___result += "              List_Option(ListOption.active);\r\n";

            ___result += "             " + UPPERFIRST + "_lookup();\r\n";

            ___result += "         }\r\n";
            ___result += " \r\n";
            #endregion []

            #region [Private Declare]

            ___result += "        #region[Private Declare] \r\n";
            ___result += " \r\n";
            ___result += "        private XShadowPanel lpanel; \r\n";
            ___result += "        private Panel linner_panel; \r\n";
            ___result += "        private MCheckBox chk_notactive; \r\n";
            ___result += "        private OfficeButton btn_search; \r\n";
            ___result += "        private LookupBox txt_" + SMALL + "_name; \r\n";
            ___result += "        private XLabel lbl_" + SMALL + "_name; \r\n";
            ___result += "        private CloseButton btn_close; \r\n";
            ___result += "        private Header lbl_header; \r\n";
            ___result += "        private OfficeButton btn_print; \r\n";
            ___result += "        private OfficeButton btn_delete; \r\n";
            ___result += "        private OfficeButton btn_edit; \r\n";
            ___result += "        private OfficeButton btn_new; \r\n";
            ___result += "        private OfficeButton btn_refresh; \r\n";
            ___result += "        private ListGridView listgrid; \r\n";
            ___result += " \r\n";
            ___result += "        #endregion[Private Declare] \r\n";
            ___result += " \r\n";
            #endregion [Private Declare]

            ___result += "        #region[Initialize] \r\n";

            ___result += "        private void Initialize() \r\n";
            ___result += "        { \r\n";
            ___result += "            DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle(); \r\n";
            ___result += "            DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle(); \r\n";
            ___result += "            DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle(); \r\n";
            ___result += "            lpanel = new XShadowPanel(); \r\n";
            ___result += "            linner_panel = new Panel(); \r\n";
            ___result += "            chk_notactive = new MCheckBox(); \r\n";
            ___result += "            txt_" + SMALL + "_name = new LookupBox(); \r\n";
            ___result += "            lbl_" + SMALL + "_name = new XLabel(); \r\n";
            ___result += "            btn_close = new CloseButton(); \r\n";
            ___result += "            lbl_header = new Header(); \r\n";
            ___result += "            btn_print = new OfficeButton(); \r\n";
            ___result += "            btn_delete = new OfficeButton(); \r\n";
            ___result += "            btn_edit = new OfficeButton(); \r\n";
            ___result += "            btn_new = new OfficeButton(); \r\n";
            ___result += "            btn_refresh = new OfficeButton(); \r\n";
            ___result += "            listgrid = new ListGridView(); \r\n";
            ___result += "            btn_search = new OfficeButton(); \r\n";
            ___result += "            lpanel.SuspendLayout(); \r\n";
            ___result += "            linner_panel.SuspendLayout(); \r\n";
            ___result += "            ((System.ComponentModel.ISupportInitialize)(listgrid)).BeginInit(); \r\n";
            ___result += "            SuspendLayout(); \r\n";
            ___result += "\r\n";
            ___result += "            lpanel.Name = \"lpanel\"; \r\n";
            ___result += "            lpanel.Dock = DockStyle.Fill; \r\n";
            ___result += "            lpanel.Size = XSize.FPanel; \r\n";
            ___result += "            lpanel.Location =XLayout.FPanel; \r\n";
            ___result += "            lpanel.BackColor = XTheme.FPanel;\r\n";
            ___result += "            lpanel.Controls.Add(linner_panel); \r\n";
            ___result += "            lpanel.Controls.Add(btn_close);\r\n";
            ___result += "            lpanel.Controls.Add(lbl_header);\r\n";
            ___result += "\r\n";
            ___result += "            linner_panel.Anchor = XAnchor.LTRB; \r\n";
            ___result += "            linner_panel.BackColor =  XTheme.LInnerpanel; \r\n";
            ___result += "            linner_panel.Controls.Add(btn_search); \r\n";
            ___result += "            linner_panel.Controls.Add(chk_notactive); \r\n";
            ___result += "            linner_panel.Controls.Add(txt_" + SMALL + "_name); \r\n";
            ___result += "            linner_panel.Controls.Add(lbl_" + SMALL + "_name); \r\n";
            ___result += "            linner_panel.Controls.Add(btn_print); \r\n";
            ___result += "            linner_panel.Controls.Add(btn_delete); \r\n";
            ___result += "            linner_panel.Controls.Add(btn_edit); \r\n";
            ___result += "            linner_panel.Controls.Add(btn_new); \r\n";
            ___result += "            linner_panel.Controls.Add(btn_refresh); \r\n";
            ___result += "            linner_panel.Controls.Add(listgrid); \r\n";
            ___result += "            linner_panel.Location = XLayout.LInnerPanel; \r\n";
            ___result += "            linner_panel.Name = \"linner_panel\"; \r\n";
            ___result += "            linner_panel.Size = XSize.LInnerPanel;\r\n";
            ___result += "\r\n";
            ___result += "            btn_close.Click += Btn_close_Click; \r\n";
            ___result += "\r\n";
            ___result += "            lbl_header.Text = \"" + ((obj.Mastertable.Alias).Replace("_", " ")).UpperFirst() + "\";\r\n";
            ___result += "\r\n";
            ___result += "            chk_notactive.Anchor = XAnchor.TR;\r\n";
            ___result += "            chk_notactive.AutoSize = true; \r\n";
            ___result += "            chk_notactive.Font = XFont.TxtFont;\r\n";
            ___result += "            chk_notactive.Location = XLayout.ListFirstBtn;\r\n";
            ___result += "            chk_notactive.MouseLocation = new Point(-1, -1); \r\n";
            ___result += "            chk_notactive.Name = \"chk_notactive\"; \r\n";
            ___result += "            chk_notactive.Size = new Size(92, 30); \r\n";
            ___result += "            chk_notactive.TabIndex = 4; \r\n";
            ___result += "            chk_notactive.Text = \"Not Active\"; \r\n";
            ___result += "            chk_notactive.CheckedChanged += new System.EventHandler(Chk_notactive_CheckedChanged); \r\n";
            ___result += "\r\n";
            ___result += "            txt_" + SMALL + "_name.Font = XFont.TxtFont; \r\n";
            ___result += "            txt_" + SMALL + "_name.ForeColor = XFontColor.TxtFontColor; \r\n";
            ___result += "            txt_" + SMALL + "_name.BackColor = XTheme.TxtBackcolor; \r\n";
            ___result += "            txt_" + SMALL + "_name.Name = \"txt_" + SMALL + "_name\"; \r\n";
            ___result += "            txt_" + SMALL + "_name.ReadOnlyBackColor = XTheme.TxtReadonlyBackcolor; \r\n";
            ___result += "            txt_" + SMALL + "_name.Size = XSize.TwoText; \r\n";
            ___result += "            txt_" + SMALL + "_name.Anchor = XAnchor.LTR; \r\n";
            ___result += "            txt_" + SMALL + "_name.Location = XLayout.FirstText; \r\n";
            ___result += "            txt_" + SMALL + "_name.TabIndex = 5; \r\n";
            ___result += "\r\n";
            ___result += "            lbl_" + SMALL + "_name.Font = XFont.Font_10B; \r\n";
            ___result += "            lbl_" + SMALL + "_name.Name = \"lbl_" + SMALL + "_name\"; \r\n";
            ___result += "            lbl_" + SMALL + "_name.Text = \"" + ((obj.Mastertable.Alias).Replace("_", " ")).UpperFirst() + "\";\r\n";
            ___result += "            lbl_" + SMALL + "_name.TextAlign = ContentAlignment.MiddleCenter; \r\n";
            ___result += "            lbl_" + SMALL + "_name.ForeColor = XFontColor.Lbl_ForeColor; \r\n";
            ___result += "            lbl_" + SMALL + "_name.Size = XSize.OneLabel; \r\n";
            ___result += "            lbl_" + SMALL + "_name.Location = XLayout.FirstLabel; \r\n";
            ___result += "\r\n";
            ___result += "            btn_search.Font = XFont.BtnFont;\r\n";
            ___result += "            btn_search.Location = new Point(txt_" + SMALL + "_name.Right + 10 ,txt_" + SMALL + "_name.Top);\r\n";
            ___result += "            btn_search.Size = new Size(75, 26); \r\n";
            ___result += "            btn_search.TabIndex = 1;\r\n";
            ___result += "            btn_search.Name = \"btn_search\";\r\n";
            ___result += "            btn_search.Text = \"&Search\";\r\n";
            ___result += "            btn_search.Themes = XTheme.YellowBtn;\r\n";
            ___result += "            btn_search.Anchor = XAnchor.TR;\r\n";
            ___result += "            btn_search.Click += Btn_search_Click;\r\n";

            ___result += "\r\n";

            ___result += "        #region[btn Properties] \r\n";

            ___result += "\r\n";
            ___result += "            btn_refresh.Font = XFont.BtnFont;\r\n";
            ___result += "            btn_refresh.Location = XLayout.BtnLocation(chk_notactive.Location);\r\n";
            ___result += "            btn_refresh.Size = XSize.BtnOne;\r\n";
            ___result += "            btn_refresh.TabIndex = 1;\r\n";
            ___result += "            btn_refresh.Name = \"btn_refresh\";\r\n";
            ___result += "            btn_refresh.Text = \"&Refresh\";\r\n";
            ___result += "            btn_refresh.Themes = XTheme.BlueBtn;\r\n";
            ___result += "            btn_refresh.Anchor = XAnchor.TR;\r\n";
            ___result += "            btn_refresh.Click += Btn_refresh_Click;\r\n";
            ___result += "\r\n";
            ___result += "            btn_new.Font = XFont.BtnFont;\r\n";
            ___result += "            btn_new.Location = XLayout.BtnLocation(btn_refresh.Location);\r\n";
            ___result += "            btn_new.Size = XSize.BtnOne;\r\n";
            ___result += "            btn_new.TabIndex = XTab.Index(btn_refresh.TabIndex);\r\n";
            ___result += "            btn_new.Name = \"btn_new\";\r\n";
            ___result += "            btn_new.Text = \"&New\";\r\n";
            ___result += "            btn_new.Themes = XTheme.BlueBtn;\r\n";
            ___result += "            btn_new.Anchor = XAnchor.TR;\r\n";
            ___result += "            btn_new.Click += Btn_new_Click;\r\n";
            ___result += "\r\n";
            ___result += "            btn_edit.Font = XFont.BtnFont;\r\n";
            ___result += "            btn_edit.Location = XLayout.BtnLocation(btn_new.Location);\r\n";
            ___result += "            btn_edit.Size = XSize.BtnOne;\r\n";
            ___result += "            btn_edit.TabIndex = XTab.Index(btn_new.TabIndex);\r\n";
            ___result += "            btn_edit.Name = \"btn_edit\";\r\n";
            ___result += "            btn_edit.Text = \"&Edit\";\r\n";
            ___result += "            btn_edit.Themes = XTheme.BlueBtn;\r\n";
            ___result += "            btn_edit.Anchor = XAnchor.TR;\r\n";
            ___result += "            btn_edit.Click += Btn_edit_Click;\r\n";
            ___result += "\r\n";
            ___result += "            btn_delete.Font = XFont.BtnFont;\r\n";
            ___result += "            btn_delete.Location = XLayout.BtnLocation(btn_edit.Location);\r\n";
            ___result += "            btn_delete.Size = XSize.BtnOne;\r\n";
            ___result += "            btn_delete.TabIndex = XTab.Index(btn_edit.TabIndex);\r\n";
            ___result += "            btn_delete.Name = \"btn_delete\";\r\n";
            ___result += "            btn_delete.Text = \"&Delete\";\r\n";
            ___result += "            btn_delete.Themes = XTheme.BlueBtn;\r\n";
            ___result += "            btn_delete.Anchor = XAnchor.TR;\r\n";
            ___result += "            btn_delete.Click += Btn_delete_Click;\r\n";
            ___result += "\r\n";
            ___result += "            btn_print.Font = XFont.BtnFont;\r\n";
            ___result += "            btn_print.Location = XLayout.BtnLocation(btn_delete.Location);\r\n";
            ___result += "            btn_print.Size = XSize.BtnOne;\r\n";
            ___result += "            btn_print.TabIndex = XTab.Index(btn_delete.TabIndex);\r\n";
            ___result += "            btn_print.Name = \"btn_print\";\r\n";
            ___result += "            btn_print.Text = \"&Print\";\r\n";
            ___result += "            btn_print.Themes = XTheme.BlueBtn;\r\n";
            ___result += "            btn_print.Anchor = XAnchor.TR;\r\n";
            ___result += "            btn_print.Click += Btn_print_Click;\r\n";
            ___result += "\r\n";
            ___result += "        #endregion[btn Properties] \r\n";

            ___result += "\r\n";
            ___result += "        #region[List Grid] \r\n";
            ___result += "\r\n";

            ___result += "            listgrid.AllowUserToAddRows = false; \r\n";
            ___result += "            listgrid.AllowUserToDeleteRows = false; \r\n";
            ___result += "            listgrid.AllowUserToOrderColumns = true; \r\n";
            ___result += "            listgrid.AllowUserToResizeRows = false; \r\n";
            ___result += "            dataGridViewCellStyle1.BackColor = Color.White; \r\n";
            ___result += "            dataGridViewCellStyle1.Font = XFont.Font_10R; \r\n";
            ___result += "            dataGridViewCellStyle1.ForeColor = Color.Black; \r\n";
            ___result += "            dataGridViewCellStyle1.SelectionBackColor = Color.FromArgb(255,255,204); \r\n";
            ___result += "            dataGridViewCellStyle1.SelectionForeColor = Color.FromArgb(252,0,11); \r\n";
            ___result += "            dataGridViewCellStyle1.WrapMode = DataGridViewTriState.True; \r\n";
            ___result += "            listgrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; \r\n";
            ___result += "            listgrid.Anchor = XAnchor.LTRB;\r\n";
            ___result += "            listgrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; \r\n";
            ___result += "            listgrid.BackgroundColor = Color.White; \r\n";
            ___result += "            listgrid.BorderStyle = BorderStyle.Fixed3D; \r\n";
            ___result += "            listgrid.CellBorderStyle = DataGridViewCellBorderStyle.Custom; \r\n";
            ___result += "            listgrid.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Custom; \r\n";
            ___result += "            dataGridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleCenter; \r\n";
            ___result += "            dataGridViewCellStyle2.BackColor = Color.FromArgb(132,192,96); \r\n";
            ___result += "            dataGridViewCellStyle2.Font = new Font(\"Microsoft Sans Serif\", 11.25F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0))); \r\n";
            ___result += "            dataGridViewCellStyle2.ForeColor = Color.White; \r\n";
            ___result += "            dataGridViewCellStyle2.Padding = new Padding(3); \r\n";
            ___result += "            dataGridViewCellStyle2.SelectionBackColor = SystemColors.Highlight; \r\n";
            ___result += "            dataGridViewCellStyle2.SelectionForeColor = SystemColors.HighlightText; \r\n";
            ___result += "            dataGridViewCellStyle2.WrapMode = DataGridViewTriState.True; \r\n";
            ___result += "            listgrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; \r\n";
            ___result += "            listgrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; \r\n";
            ___result += "            listgrid.Cursor = Cursors.Default; \r\n";
            ___result += "            dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleLeft; \r\n";
            ___result += "            dataGridViewCellStyle3.BackColor = Color.White; \r\n";
            ___result += "            dataGridViewCellStyle3.Font = XFont.Font_10R; \r\n";
            ___result += "            dataGridViewCellStyle3.ForeColor = Color.Black; \r\n";
            ___result += "            dataGridViewCellStyle3.SelectionBackColor = Color.FromArgb(255,255,204); \r\n";
            ___result += "            dataGridViewCellStyle3.SelectionForeColor = Color.FromArgb(252,0,11); \r\n";
            ___result += "            dataGridViewCellStyle3.WrapMode = DataGridViewTriState.False; \r\n";
            ___result += "            listgrid.DefaultCellStyle = dataGridViewCellStyle3; \r\n";
            ___result += "            listgrid.EnableHeadersVisualStyles = false; \r\n";
            ___result += "            listgrid.GridColor = Color.SeaGreen; \r\n";
            ___result += "            listgrid.MultiSelect = false; \r\n";
            ___result += "            listgrid.Name = \"listgrid\"; \r\n";
            ___result += "            listgrid.ReadOnly = true; \r\n";
            ___result += "            listgrid.RowHeadersVisible = false; \r\n";
            ___result += "            listgrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect; \r\n";
            ___result += "            listgrid.Location = XLayout.ListView; \r\n";
            ___result += "            listgrid.Size = XSize.ListView; \r\n";
            ___result += "            listgrid.StandardTab = true; \r\n";
            ___result += "            listgrid.TabIndex = 0; \r\n";
            ___result += "\r\n";
            ___result += "        #endregion[List Grid] \r\n";
            ___result += "\r\n";

            ___result += "            AutoScaleDimensions = new SizeF(6F, 13F); \r\n";
            ___result += "            AutoScaleMode = AutoScaleMode.Font; \r\n";
            ___result += "            Controls.Add(lpanel); \r\n";
            ___result += "            Name = \"L" + UPPERFIRST + "\"; \r\n";
            ___result += "            Size = new Size(1000, 600); \r\n";
            ___result += "            lpanel.ResumeLayout(false); \r\n";
            ___result += "            linner_panel.ResumeLayout(false); \r\n";
            ___result += "            linner_panel.PerformLayout(); \r\n";
            ___result += "            ((System.ComponentModel.ISupportInitialize)(listgrid)).EndInit(); \r\n";
            ___result += "            ResumeLayout(false); \r\n";
            ___result += " \r\n";
            ___result += "        } \r\n";
            ___result += " \r\n";
            ___result += "        #endregion[Initialize] \r\n";
            ___result += " \r\n";


            #region [result]

            ___result += "    }//cls \r\n";
            ___result += "}//ns \r\n";

            return(___result);

            #endregion [result]
        }
예제 #31
0
        private static string XCreate(BillTable obj)
        {
            List <SFields> list = obj.SFields;

            string vtablesname = obj.STables.Stables_name;

            string vnamespaces = obj.STables.Namespaces_id;

            string TABLENAME = vtablesname.ToUpper();

            string TRIM_TBL = vtablesname.Remove(vtablesname.Length - 4);

            string CAPITAL    = cCultureInfo.toUpperCase(TRIM_TBL);
            string SMALL      = cCultureInfo.toLowerCase(TRIM_TBL);
            string UPPERFIRST = ChangeCase.UpperFirst(SMALL);
            string ___result  = "";

            #endregion []

            #region [Conclusion]

            ___result += "// " + CVersion_exten.Get_Current_Version() + "\r\n";
            ___result += "// Auto Generated\r\n";
            ___result += "// " + DateTime.Now + "\r\n";
            ___result += "// last update : " + DateTime.Now.ToString("dd-MM-yyyy") + "\r\n";
            ___result += "\r\n";

            #endregion [Conclusion]
            //
            #region [Designer]
            //
            ___result += "namespace " + vnamespaces + "\r\n";
            ___result += "        { \r\n";
            ___result += "        public partial class F" + UPPERFIRST + "\r\n";
            ___result += "        {\r\n";
            ___result += "        private System.ComponentModel.IContainer components = null; \r\n";
            ___result += "        \r\n";
            ___result += "        protected override void Dispose(bool disposing) \r\n";
            ___result += "        {\r\n";
            ___result += "            if (disposing && (components != null)) \r\n";
            ___result += "            {\r\n";
            ___result += "            components.Dispose(); \r\n";
            ___result += "            }\r\n";
            ___result += "            base.Dispose(disposing); \r\n";
            ___result += "        }\r\n";
            ___result += "        \r\n";
            //___result += "         #region [InitializeComponent] \r\n";
            ___result += "        \r\n";
            ___result += "        private void InitializeComponent() \r\n";
            ___result += "        {\r\n";
            ___result += "            components = new System.ComponentModel.Container();\r\n";
            ___result += "            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r\n";
            ___result += "        } \r\n";
            ___result += "        \r\n";
            //___result += "        #endregion [InitializeComponent] \r\n";
            //
            #endregion [Designer]
            //
            #region [result]
            //
            ___result += "    }//cls \r\n";
            ___result += "}//ns \r\n";
            //
            return(___result);

            //
            #endregion [result]
            //
        }