Inheritance: INotifyPropertyChanged
示例#1
0
        public void OrderBy_Works_On_Types_Other_Than_InstanceType()
        {
            var instance = new OtherClass();

            var actual = instance.OrderBy(x => x.StringProperty, OrderBy.Descending);

            Assert.AreEqual("$orderby=(StringProperty desc)", actual.ToString());
        }
示例#2
0
    public Chapter4()
    {
        int a = 999, b = 333;
        double d; //без инициализации
        OtherClass obj1 = new OtherClass(1, 3, ConsoleColor.Red);
        OtherClass obj2 = new OtherClass(4, 6, ConsoleColor.Green);
        OtherClass obj3 = new OtherClass(7, 9, ConsoleColor.Blue);

        Console.WriteLine("a: {0}, b: {1}", a, b);
        obj1.Swap(ref a, ref b); //принудительный вызов по ссылке, передаваемые аргументы должны быть инициализированны
        Console.WriteLine("a: {0}, b: {1}", a, b);

        /* возврат значения из метода out,
         * только возврат в метод ничего не передается,
         * поэтому инициализация переменной ненужна
         * */
        b = obj1.GetParts(24.8877, out d);
        Console.WriteLine("целая: {0}, дробная: {1}\n\n", b, d);

        Console.Write("odj2 - ");
        obj2.Draw();

        Console.Write("obj3 - ");
        obj3.Draw();

        Console.Write("\nSwap\n\n");

        /* передача ссылки на объект по ссылке
         * позволяет менять объект
         * на который указывает ссылка
         * */
        obj1.SwapObj(ref obj2, ref obj3);

        Console.Write("odj2 - ");
        obj2.Draw();

        Console.Write("obj3 - ");
        obj3.Draw();

        /* передача произвольного
         * количества аргументов
         * params в списке параметров всегда последний
         * */
        int min;

        min = obj1.MinVal("text argument", 21, 54, 67, 21, 1, 23, -45, -35, -12, -13, 4, 6, 7, 8, 5);
        Console.WriteLine("min: {0}", min);

        int[] arrr3 = { 12, 24, 48, 56, 32, 1, 2, -51, -45, -55, -75 };
        min = obj1.MinVal("text argument",arrr3);
        Console.WriteLine("min: {0}", min);

        min = obj1.MinVal("text argument");
    }
示例#3
0
    static void Main()
    {
        int alpha = 0;
        int beta = 0;
        OtherClass[] arrray1 = new OtherClass[10];
        for (int a = 0; a < 10; a++)
            arrray1[a] = new OtherClass(alpha++, beta++);

        foreach (OtherClass obj in arrray1) //перебор массива объектов и вызов метода каждого объекта
            obj.PrintActiv();
    }
示例#4
0
 // private 생성자(Deserialization)
 private MyType5(SerializationInfo info, StreamingContext context)
 {
     _lable = info.GetString("_lable");
     _object = (OtherClass)info.GetValue("_object", typeof(OtherClass));
     try
     {
         _value2 = info.GetInt32("_value2");
     }
     catch
     {
         _value2 = DEFAULT_VALUE;
     }
 }
示例#5
0
    public Chapter3()
    {
        OtherClass obj1 = new OtherClass(1, 3, ConsoleColor.Red);
        OtherClass obj2 = new OtherClass(4, 6, ConsoleColor.Green);
        OtherClass obj3 = new OtherClass(7, 9, ConsoleColor.Blue);

        Console.Write("odj1 - ");
        obj1.Draw();

        Console.Write("obj2 - ");
        obj2.Draw();

        Console.Write("obj3 - ");
        obj3.Draw();

        obj1.Copy(obj2); // в поля obj1 копируются значения obj2

        Console.Write("odj1 - ");
        obj1.Draw();

        // obj2 передается по ссылке, и изменения в методе будут влиять на сам объект
        obj1.Change(obj2);

        Console.Write("obj2 - ");
        obj2.Draw();

        obj1.alpha = 25; // изменяем поля obj1
        obj1.beta = 25;

        Console.Write("odj1 - ");
        obj1.Draw();

        Console.Write("obj2 - ");
        obj2.Draw(); // поля obj2 при этом не меняются

        obj1 = obj3; // теперь ссылку obj3 присваеваем obj1

        /*
         * obj1 и obj2 ссылаются на один объект
         * */
        Console.Write("odj1 - ");
        obj1.Draw();

        obj1.alpha = 25; // изменяем поля obj1
        obj1.beta = 25;

        Console.Write("obj3 - ");//поля obj3 "тоже меняются" так как объект один с obj1
        obj3.Draw();
    }
  void Start(){
		var c1 = new OtherClass();
		var c2 = new OtherClass();
		Debug.Log(Game.isPaused.GetValue());
		
		c1.SetPaused();
		Debug.Log(Game.isPaused.GetValue());
		
		c2.SetPaused();
		Debug.Log(Game.isPaused.GetValue());
		
		c1.UnsetPaused();
		Debug.Log(Game.isPaused.GetValue());
		
		c2.UnsetPaused();
		Debug.Log(Game.isPaused.GetValue());
	}
示例#7
0
        static void Main(string[] args)
        {
            Console.WriteLine("Main Init");
            for (int i = 0; i < 2; i++)
            {
                Console.WriteLine(Singleton.IncrementCounter());
            }

            //in constructor use Singleton
            OtherClass oc = new OtherClass();

            for (int i = 0; i < 2; i++)
            {
                Console.WriteLine(Singleton.IncrementCounter());
            }
            Console.WriteLine("Main End!");
            //stop console to see
            Console.ReadKey();
        }
    void Start()
    {
        var c1 = new OtherClass();
        var c2 = new OtherClass();

        Debug.Log(Game.isPaused.GetValue());

        c1.SetPaused();
        Debug.Log(Game.isPaused.GetValue());

        c2.SetPaused();
        Debug.Log(Game.isPaused.GetValue());

        c1.UnsetPaused();
        Debug.Log(Game.isPaused.GetValue());

        c2.UnsetPaused();
        Debug.Log(Game.isPaused.GetValue());
    }
示例#9
0
    public int GetAutoId()
    {
        DataSet ds = new DataSet();
        int     AId;

        ds = OtherClass.Idv_Chetana_GetAutoId();
        if (ds.Tables[0].Rows.Count > 0)
        {
            DataTable tbl = ds.Tables[0];
            DataRow   dr  = tbl.Rows[0];
            AId = Convert.ToInt32(dr[0].ToString());
        }
        else
        {
            AId = 0;
        }
        AId = AId + 1;
        return(AId);
    }
示例#10
0
    public DataView BindCustomerMasterDetail()
    {
        try
        {
            DataTable dt = new DataTable();
            //dt = Customer_cs.Get_CustList("ExportCustomerNew", "");
            //Response.Write("Before");
            dt = OtherClass.Get_CustomerData_For_Export("ExportCustomerNew", DDLCC.SelectedValue.ToString(), ddlSDZone.SelectedValue.ToString(), DDLSuperZone.SelectedValue.ToString());
            //Response.Write("After");
            DataView dv = new DataView(dt);

            return(dv);
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
            DataView dv = new DataView();
            return(dv);
        }
    }
示例#11
0
    public void GetData()
    {
        DataSet   ds = new DataSet();
        DataTable tbl;

        ds = OtherClass.Idv_Chetana_Get_Global_Commission(0, 0, 0, Convert.ToInt32(strFY));

        if (ds.Tables[0].Rows.Count > 0)
        {
            GrdComm.DataSource = ds.Tables[0];
            GrdComm.DataBind();
            tbl = ds.Tables[0];
            DataRow dr = tbl.Rows[0];
            txtcnper.Text = dr["CNPer"].ToString() == "" ? "0.00" : Convert.ToDecimal(dr["CNPer"]).ToString("0.00");
        }
        else
        {
            MessageBox("Kindly SET COMMISSION...");
        }
    }
示例#12
0
        public void SerializableListTest()
        {
            var source = new OtherClass()
            {
                Items = new SerializableDictionary <string, SerializableList <SomeClass> >()
            };

            source.Items.Add("test1", new SerializableList <SomeClass> {
                new SomeClass()
                {
                    A = "A1", B = "B1"
                }
            });
            source.Items.Add("test2", new SerializableList <SomeClass> {
                new SomeClass()
                {
                    A = "A2", B = "B2"
                }
            });

            var xmlDoc = XmlDocumentConverter.ConvertFrom(source);
            var target = XmlDocumentConverter.ConvertTo <OtherClass>(xmlDoc);
        }
示例#13
0
        public bool validateOtherClass(OtherClass obj, DiagnosticChain diagnostics, Dictionary <object, object> context)
        {
            if (!validate_NoCircularContainment(obj, diagnostics, context))
            {
                return(false);
            }
            bool result = validate_EveryMultiplicityConforms(obj, diagnostics, context);

            if (result || diagnostics != null)
            {
                result &= validate_EveryDataValueConforms(obj, diagnostics, context);
            }
            if (result || diagnostics != null)
            {
                result &= validate_EveryReferenceIsContained(obj, diagnostics, context);
            }
            if (result || diagnostics != null)
            {
                result &= validate_EveryBidirectionalReferenceIsPaired(obj, diagnostics, context);
            }
            //if (result || diagnostics != null) result &= validate_EveryProxyResolves(obj, diagnostics, context);
            if (result || diagnostics != null)
            {
                result &= validate_UniqueID(obj, diagnostics, context);
            }
            if (result || diagnostics != null)
            {
                result &= validate_EveryKeyUnique(obj, diagnostics, context);
            }
            if (result || diagnostics != null)
            {
                result &= validate_EveryMapEntryUnique(obj, diagnostics, context);
            }

            return(result);
        }
示例#14
0
    static void Main()
    {
        OtherClass oc = new OtherClass();

        oc.PrintField1();
    }
示例#15
0
文件: Program.cs 项目: wpmyj/dotnet
        private ArrayList m_aryClients = new ArrayList();       // List of Client Connections
        /// <summary>
        /// Application starts here. Create an instance of this class and use it
        /// as the main object.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            AppMain app = new AppMain();

            oc = new OtherClass();
            wr = new WaterResources();
            // Welcome and Start listening
            Console.WriteLine("*** hash水质监测 Server Started {0} *** ", DateTime.Now.ToString("G"));
            //测试报文
            // byte[] test = strToToHexByte("683D68BA9970990E04C05F0600001841020000550800008300000010000000420000005200000000000000500000005000000034020000000030000000081600F816");



            objhelper = new SqlHelper();
            connABB   = objhelper.getConn();
            if (connABB.State != ConnectionState.Open)
            {
                connABB.Open();
            }
            objhelper = new SqlHelper();
            connABB   = objhelper.getConn();
            connABB.Open();

            // Method 2
            //
            int       nPortListen = oc.lPort();
            IPAddress ip          = IPAddress.Parse(oc.IPAddress());
            // Determine the IPAddress of this machine

            String strHostName = "";

            try
            {
                // NOTE: DNS lookups are nice and all but quite time consuming.
                strHostName = Dns.GetHostName();
            }
            catch (Exception ex)
            {
                Console.WriteLine("试图获得本地地址错误 {0} ", ex.Message);
            }


            Console.WriteLine("开始监听数据: [{0}] {1}:{2}", strHostName, ip, nPortListen);

            // Create the listener socket in this machines IP address
            Socket listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);


            listener.Bind(new IPEndPoint(ip, nPortListen));
            //listener.Bind( new IPEndPoint( IPAddress.Loopback, 399 ) );	// For use with localhost 127.0.0.1
            listener.Listen(30);

            // Setup a callback to be notified of connection requests
            listener.BeginAccept(new AsyncCallback(app.OnConnectRequest), listener);

            Console.WriteLine("按任意键退出");
            Console.ReadLine();
            Console.WriteLine("退出中...");

            // Clean up before we go home
            if (connABB.State != ConnectionState.Closed)
            {
                connABB.Close();
            }
            connABB.Close();
            listener.Close();
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
 public ClassWithFieldFromOtherClass()
 {
     otherClass = new OtherClass();
 }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            XmlDocument doc = new XmlDocument();          // Object cmlDocument
            XmlElement  nd;
            XmlNode     node = doc.CreateElement("Root"); // Root Note
            int         flag = 1;

            foreach (GridViewRow item in GrdComm.Rows)
            {
                XmlNode element = doc.CreateElement("Items");

                nd           = doc.CreateElement("Id");
                nd.InnerText = ((Label)item.FindControl("lbl1")).Text.Trim();
                element.AppendChild(nd);

                nd           = doc.CreateElement("DisFrm");
                nd.InnerText = ((TextBox)item.FindControl("TxtDisF")).Text.Trim();
                element.AppendChild(nd);

                nd           = doc.CreateElement("DisTo");
                nd.InnerText = ((TextBox)item.FindControl("txtdisTo")).Text.Trim();
                element.AppendChild(nd);

                nd           = doc.CreateElement("tarfrm");
                nd.InnerText = ((TextBox)item.FindControl("txttarfrm")).Text.Trim();
                element.AppendChild(nd);

                nd           = doc.CreateElement("tarto");
                nd.InnerText = ((TextBox)item.FindControl("txttarto")).Text.Trim();
                element.AppendChild(nd);

                nd           = doc.CreateElement("commz");
                nd.InnerText = ((TextBox)item.FindControl("txtzcomm")).Text.Trim();
                element.AppendChild(nd);

                nd           = doc.CreateElement("comms");
                nd.InnerText = ((TextBox)item.FindControl("txtscomm")).Text.Trim();
                element.AppendChild(nd);

                nd           = doc.CreateElement("commsdz");
                nd.InnerText = ((TextBox)item.FindControl("txtsdzcomm")).Text.Trim();
                element.AppendChild(nd);

                nd = doc.CreateElement("a");

                if (((CheckBox)item.FindControl("chkActive")).Checked)
                {
                    nd.InnerText = "True";
                }
                else
                {
                    nd.InnerText = "False";
                }

                element.AppendChild(nd);

                nd           = doc.CreateElement("cnper");
                nd.InnerText = txtcnper.Text.Trim();

                element.AppendChild(nd);
                node.AppendChild(element);
            }

            Int32 sdzoneid = Convert.ToInt32(ddlSDZone.SelectedValue.ToString());
            Int32 szoneid  = Convert.ToInt32(DDLSuperZone.SelectedValue.ToString());
            Int32 zoneid   = Convert.ToInt32(DDLZone.SelectedValue.ToString());

            OtherClass.Idv_Chetana_Save_Update_Commission(sdzoneid, szoneid, zoneid, Convert.ToInt32(strFY), node.OuterXml.ToString(), flag);
            MessageBox("Record saved successfully...");

            PnllGrdComm.Visible = false;
        }
        catch (Exception ex)
        {
        }
    }
示例#18
0
        public void _01()
        {
            var oc = new OtherClass();

            oc.Method01(oc.Field1);
        }
示例#19
0
 public ClassWithFieldFromOtherClass()
 {
     otherClass = new OtherClass();
 }
示例#20
0
        public void Filter_Works_On_Types_Other_Than_The_InstanceType()
        {
            var instance = new OtherClass();
            const int rightSide = 23;

            var actual = instance.Filter(x => x.IntegerProperty == rightSide);

            Assert.AreEqual("$filter=(IntegerProperty eq '23')", actual.ToString());
        }
 // 3. Finally, bind data.
 // Do it in the construct of your class
 public ClassName()
 {
     // Use the UltraGrid name you assigned to
     // your UltraGrid.
     ugMyUltraGrid.DataSource = OtherClass.loadData();
 }
 static void Main(string[] args)
 {
     OtherClass.OtherMethod();
 }
 void OtherMethod3(SomeClass c)
 {
     OtherClass oc = (OtherClass)c; // Does not compile because compiler knows
 }                                  // that SomeClass does not inherit from OtherClass!
示例#24
0
 public MainForm()
 {
     /* just two controls -- listBox1 and button1 */
     InitializeComponent();
     otherClass = new OtherClass(this.TextToBox);
 }
 static void Main(string[] args)
 {
     int i;
     int j = OtherClass.Test(out i);
 }
 public PluginManager(OtherClass otherClass)
 {
     this.otherClass              = otherClass;
     this.otherClass.PluginEvent += otherClass_PluginEvent;
     SomeMethod();
 }
    public void ShowDetails(int Showata)
    {
        DataSet ds = new DataSet();

        if (RdbtnSelect.SelectedValue == "Commission_Report")
        {
            if (Showata == 1)
            {
                Session["DataFillCommission"] = null;
            }
            if (Session["DataFillCommission"] == null)
            {
                ds = LoanPartyMaster.Report_Commision(Convert.ToInt32(DDLSuperZone.SelectedValue.ToString()), Convert.ToInt32(DDLZone.SelectedValue.ToString()),
                                                      (txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2]), (txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2]), Convert.ToInt32(strFY));
                Session["DataFillCommission"] = ds;
            }

            ds = (DataSet)Session["DataFillCommission"];

            //DataSet ds2 = new DataSet();
            //ds2 = Idv.Chetana.BAL.Specimen.Idv_Chetana_Get_CustomerDetailsForReport(Convert.ToInt32(ddlCustmore.SelectedValue.ToString()));

            ReportDocument rd = new ReportDocument();
            rd.Load(Server.MapPath("~/Report/CommissionReport.rpt"));

            //if (ds.Tables[1].Rows.Count > 0)
            //{

            rd.Database.Tables[0].SetDataSource(ds.Tables[0]);

            //rd.Database.Tables[1].SetDataSource(ds.Tables[1]);
            //rd.Database.Tables[1].SetDataSource(dv2);
            //rd.SetDataSource(ds);
            //}
            //else
            //{
            //    if (Showata == 1)
            //    {
            //        MessageBox("Target yet not set to selected Zone");
            //    }
            //}

            CustomerReportView.ReportSource = rd;
        }
        else
        {
            int szone = 0;

            if (DDLSuperZone.SelectedIndex == 0)
            {
                szone = 0;
            }
            else
            {
                szone = Convert.ToInt32(DDLSuperZone.SelectedValue.ToString());
            }

            ds = OtherClass.Idv_Chetana_Report_Comm(szone, 0,
                                                    (txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2]), (txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2]), Convert.ToInt32(strFY));

            ReportDocument rd = new ReportDocument();
            rd.Load(Server.MapPath("~/Report/CommissionReport_Summary.rpt"));

            if (ds.Tables[0].Rows.Count > 0)
            {
                rd.SetDataSource(ds.Tables[0]);
                rd.SetParameterValue("FDate", txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2]);
                rd.SetParameterValue("TDate", txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2]);
            }
            else
            {
                if (Showata == 1)
                {
                    MessageBox("Target yet not set to selected Zone");
                }
            }

            CustomerReportView.ReportSource = rd;
        }
    }
示例#28
0
 public ValueWrapper(OtherClass wrapped)
 {
     _wrapped = wrapped;
 }
示例#29
0
        public void _01()
        {
            var oc = new OtherClass();

            oc.PrintField1();
        }
示例#30
0
 static void Main(string[] args)
 {
     OtherClass.OutputSomething();
     System.Console.ReadKey();
 }
    public void Bind()
    {
        if (ddlSDZone.SelectedIndex == 0 || DDLSuperZone.SelectedIndex == -1 || DDLZone.SelectedIndex == -1 || ddlCustmore.SelectedIndex == -1)
        {
            return;
        }

        DataSet ds = new DataSet();
        int     Zone, cust;
        string  Months    = string.Empty;
        string  MonthsVal = string.Empty;

        if (DDLZone.SelectedIndex == 0)
        {
            Zone = 0;
            cust = 0;
        }
        else
        {
            Zone = Convert.ToInt32(DDLZone.SelectedValue.ToString());
            if (ddlCustmore.SelectedIndex == 0 || ddlCustmore.SelectedIndex == -1)
            {
                cust = 0;
            }
            else
            {
                cust = Convert.ToInt32(ddlCustmore.SelectedValue.ToString());
            }
        }

        if (ChkAll.Checked)
        {
            Months    = "0";
            MonthsVal = "0";
        }
        else
        {
            if (chkApr.Checked)
            {
                Months    += "4" + ",";
                MonthsVal += "apr" + ",";
            }
            if (chkMay.Checked)
            {
                Months    += "5" + ",";
                MonthsVal += "may" + ",";
            }
            if (chkJun.Checked)
            {
                Months    += "6" + ",";
                MonthsVal += "jun" + ",";
            }
            if (chkJul.Checked)
            {
                Months    += "7" + ",";
                MonthsVal += "jul" + ",";
            }
            if (chkAug.Checked)
            {
                Months    += "8" + ",";
                MonthsVal += "aug" + ",";
            }
            if (chkSep.Checked)
            {
                Months    += "9" + ",";
                MonthsVal += "sep" + ",";
            }
            if (chkOct.Checked)
            {
                Months    += "10" + ",";
                MonthsVal += "oct" + ",";
            }
            if (chkNov.Checked)
            {
                Months    += "11" + ",";
                MonthsVal += "nov" + ",";
            }
            if (chkDec.Checked)
            {
                Months    += "12" + ",";
                MonthsVal += "dec" + ",";
            }
            if (chkJan.Checked)
            {
                Months    += "1" + ",";
                MonthsVal += "jan" + ",";
            }
            if (chkFeb.Checked)
            {
                Months    += "2" + ",";
                MonthsVal += "feb" + ",";
            }
            if (chkMar.Checked)
            {
                Months    += "3" + ",";
                MonthsVal += "mar" + ",";
            }
        }
        if (Months != string.Empty)
        {
            if (Months.EndsWith(","))
            {
                Months = Months.Remove(Months.Length - 1);
            }
        }


        try
        {
            if (Session["MOMCOMP"] != null)
            {
                ds = (DataSet)Session["MOMCOMP"];
            }
            else
            {
                ds = OtherClass.Get_Order_Compare(Convert.ToInt32(ddlSDZone.SelectedValue.ToString()), Convert.ToInt32(DDLSuperZone.SelectedValue.ToString()), Zone, cust, Convert.ToInt32(strFY), Months);
                Session["MOMCOMP"] = ds;
            }

            if (ds.Tables[0].Rows.Count > 0)
            {
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/YoY_Monthly_Sales_Comparision_Report.rpt"));
                rd.SetDataSource(ds.Tables[0]);
                rd.SetParameterValue("SDZone", ddlSDZone.SelectedItem.Text.ToString());
                rd.SetParameterValue("SuperZone", DDLSuperZone.SelectedItem.Text.ToString());
                rd.SetParameterValue("VisMonths", MonthsVal);
                CrMothlyreport.ReportSource = rd;
            }

            else
            {
                MessageBox("No Records found...");
            }
        }
        catch (Exception ex)
        { }
    }
示例#32
0
 public ClassWithAReadonlyField(int someProp)
 {
     _privateField = new OtherClass(someProp);
 }
 static void Main()
 {
     Console.WriteLine("Testing of the csc!");
     OtherClass obj = new OtherClass();
     obj.Show();
 }
示例#34
0
 internal void Test()
 {
     OtherClass.Method(ref k);
 }
示例#35
0
    public void BindData()
    {
        string from = txtfromDate.Text.Split('/')[2] + "/" + txtfromDate.Text.Split('/')[1] + "/" + txtfromDate.Text.Split('/')[0];
        string To   = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0];

        fdate = Convert.ToDateTime(from);
        tdate = Convert.ToDateTime(To);
        int szone, zone;

        if (ddlSDZone.SelectedIndex == 0)
        {
            szone = zone = 0;
        }
        else
        if (DDLSuperZone.SelectedIndex == 0)
        {
            szone = Convert.ToInt32(DDLSuperZone.SelectedValue.ToString());
            zone  = 0;
        }
        else
        {
            if (DDLSuperZone.SelectedIndex == -1)
            {
                szone = 0;
            }
            else
            {
                szone = Convert.ToInt32(DDLSuperZone.SelectedValue.ToString());
            }

            if (DDLZone.SelectedIndex == -1)
            {
                zone = 0;
            }
            else
            {
                zone = Convert.ToInt32(DDLZone.SelectedValue.ToString());
            }
        }

        if (fdate > tdate)
        {
            MessageBox("From Date is Greater than ToDate");
            txtfromDate.Focus();
        }
        else
        {
            string  BookTypecode = txtbktype.Text.ToString().Split(':')[0].Trim();
            DataSet ds           = new DataSet();
            ds = OtherClass.Idv_Chetana_Rep_Booktypewise_A_Report(BookTypecode, fdate, tdate, Convert.ToInt32(ddlSDZone.SelectedValue.ToString()), szone, zone, Convert.ToInt32(strFY));

            //ds = OtherClass.Idv_Chetana_Rep_Booktypewise_A_Report(BookTypecode, fdate, tdate, ddlSDZone.SelectedValue.ToString(), DDLSuperZone.SelectedValue.ToString(), DDLZone.SelectedValue.ToString(), Convert.ToInt32(strFY));
            if (ds.Tables[0].Rows.Count > 0)
            {
                ViewState["Bkwise"] = ds.Tables[0];
                ReportDocument CR = new ReportDocument();
                CR.Load(Server.MapPath("Report/Booktypewise_Amt_Summary.rpt"));
                CrptBookwiseSummary.SeparatePages = true;
                CR.SetDataSource(ds.Tables[0]);
                CrptBookwiseSummary.ReportSource = CR;

                //                txtbkcod.Text = "";
                // txtbktype.Text = "";
            }
            else
            {
                MessageBox("No Records Found");
                RdbtnSelect.Focus();
                //  txtbkcod.Text = "";
                //   txtbktype.Text = "";
            }
        }
    }
示例#36
0
 public void Change(OtherClass ob)
 {
     ob.alpha = ob.alpha + ob.beta;
     ob.beta = -ob.beta;
     ob.color = ConsoleColor.White;
 }
示例#37
0
 public SampleController(IEnumerable <ISampleSimpleText> samples, OtherClass otherClass)
 {
     this.samples    = samples;
     this.otherClass = otherClass;
 }
示例#38
0
 public void Copy(OtherClass obj)
 {
     this.alpha = obj.alpha;
     this.beta = obj.beta;
     this.color = obj.color;
 }
    protected void btnget_Click(object sender, EventArgs e)
    {
        if (Convert.ToInt32(DDLSuperZone.SelectedValue) <= 0)
        {
            MessageBox("Kindly select Superzone and Zone...");
        }
        else
        {
            PnllGrdComm.Visible = true;
            DataSet   ds = new DataSet();
            DataTable tbl;
            ds = OtherClass.Idv_Chetana_Get_Global_Commission(0, Convert.ToInt32(DDLSuperZone.SelectedValue.ToString()), Convert.ToInt32(DDLZone.SelectedValue.ToString()), Convert.ToInt32(strFY));

            if (ds.Tables[1].Rows.Count > 0)
            {
                GrdComm.DataSource = ds.Tables[1];
                GrdComm.DataBind();
                tbl = ds.Tables[1];
                DataRow dr = tbl.Rows[0];
                txtcnper.Text = dr["CNPer"].ToString() == "" ? "0.00" : Convert.ToDecimal(dr["CNPer"]).ToString("0.00");
            }
            else if (ds.Tables[0].Rows.Count > 0)
            {
                GrdComm.DataSource = ds.Tables[0];
                GrdComm.DataBind();
                tbl = ds.Tables[0];
                DataRow dr = tbl.Rows[0];
                txtcnper.Text = dr["CNPer"].ToString() == "" ? "0.00" : Convert.ToDecimal(dr["CNPer"]).ToString("0.00");
            }
            else
            {
                //MessageBox("Kindly SET COMMISSION...");
            }
        }

        //if (Convert.ToInt32(DDLSuperZone.SelectedValue) <= 0)
        //{
        //    MessageBox("Kindly select Superzone and Zone...");
        //}
        //else
        //{

        //    PnllGrdComm.Visible = true;
        //    DataSet ds = new DataSet();
        //    DataTable tbl;
        //    ds = OtherClass.Idv_Chetana_Get_Global_Commission(0, Convert.ToInt32(DDLSuperZone.SelectedValue.ToString()), Convert.ToInt32(DDLZone.SelectedValue.ToString()), Convert.ToInt32(strFY));

        //    if (ds.Tables[1].Rows.Count > 0)
        //    {
        //        GrdComm.DataSource = ds.Tables[1];
        //        GrdComm.DataBind();
        //        tbl = ds.Tables[1];
        //        DataRow dr = tbl.Rows[0];
        //        txtcnper.Text = dr["CNPer"].ToString() == "" ? "0.00" : Convert.ToDecimal(dr["CNPer"]).ToString("0.00");

        //    }
        //    else
        //    {
        //        MessageBox("Commission not set for this superzone and zone...");
        //        PnllGrdComm.Visible = false;
        //    }
        //}
    }
示例#40
0
 public void SwapObj(ref OtherClass obj1, ref OtherClass obj2)
 {
     OtherClass swap;
     swap = obj1;
     obj1 = obj2;
     obj2 = swap;
 }
示例#41
0
    static void Main()
    {
        OtherClass oc = new OtherClass();                         // Use the masking member.

        oc.Method1(oc.Field1);                                    // Use the masking member.
    }
    void SomeMethod()
    {
        OtherClass otherClass = new OtherClass(this.TextToBox);

        otherClass.SomePublicMethod();
    }